Apollo Reactive Store
An simple api for manage and update apollo reactive vars.
Why?
Global state management is alway a problem, reactive store provide an option to manage global state with graphql api. Simplify the complexity to manage global state in other state management library.
Usage
; // create storeconst store = ; // initialize in apollo clientconst client = uri: "http://localhost:3000/" cache: typePolicies: store ; // use it in component { const loading error data = ; if loading || error return null const counter = data; return <div> <h1>counter</h1> <button onClick= store>+1</button> <button onClick= store>-1</button> </div> ;} // use actions to mutate state and isolate logics const actions = { return ...uiState open } { const loading error data = ; if loading || error return null const uiState: open = data; return <div> <h1>is it open? open</h1> <button onClick= store>open</button> <button onClick= store>close</button> </div> );}