rillstone / ella

Research project for fourth year studies at the University of Auckland
2 stars 0 forks source link

global storage beginning with user #22

Closed swimuel closed 5 years ago

swimuel commented 5 years ago

Related Issue/Keyword:

Relates to #12

Description:

Adds react-recontext, a package which allows global storage of state. Establishes a global store with actions defined to "dispatch" to that state (similar to setState). call the actions using dispatch("ACTION_NAME", { var: your_var }) in accordance with the action where actionName -> ACTION_NAME. for each class you want to access the global store, change the export to include connect(mapStateToProps)() and then include a mapping const mapStateToProps = state=> ({ var: state.var, });

Testing:

will need to npm install to get the react-recontext package

Steps for manual testing:

  1. Check works as expected.

Checklist: