beekai-oss / little-state-machine

📠 React custom hook for persist state management
https://lrz5wloklm.csb.app/
MIT License
1.47k stars 53 forks source link

how to get the global state value outside of the component. #141

Closed NarenderSiri closed 1 year ago

NarenderSiri commented 1 year ago

const log = (store) => { return store; };

createStore({ yourDetail: { tenantId: "" },

},{ middleWares: [ log ], } );

export const Getstatevalue = {
// i want to export the state value from here out side the component }

const App=() => { //It is working here const { actions, state,getState } = useStateMachine({ updateName }); }

bluebill1049 commented 1 year ago

no supported at moment, we can consider that later on.