What is the working of AddSelectors() and SelectPartnerState() ? #50
Unanswered
Kundan-pseudo
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
// test file
import { Button } from '@mui/material';
import React from 'react'
import { useDispatch, useSelector} from 'react-redux';
import { setCounterIncrement } from './store/slices/counterSlice';
import { GlobalStore } from 'redux-micro-frontend';
import store from './store/RootReducer';
const test = () => {
const counter=0;
const globalStore = GlobalStore.Get();
React.useEffect(() => {
globalStore.RegisterStore("CounterApp", store);
const unsubscribe = globalStore.SubscribeToGlobalState("CounterApp", globalStateChanged);
globalStore.AddSelectors("CounterApp",counterSelectors);
}, []);
return (
{counter}
)
}
export default test
// testing.tsx file
import { Button } from '@mui/material';
import { GlobalStore } from 'redux-micro-frontend';
const testing = () => {
const partnerState = GlobalStore.Get().SelectPartnerState('CounterApp','getCount');
const handleClick = () =>{
console.log("Hi",partnerState)
}
return (
)
}
export default testing
in the testing.tsx file partnerState is setting to undefined
Beta Was this translation helpful? Give feedback.
All reactions