Reffering to the boilerplate: NordicSemiconductor/pc-nrfconnect-boilerplate
Can someone make a quick guide to create a reducer that is connected to the nRFConnectCore[0] store in the boilerplate? Just the minimal necessities.
If this question is wrong because the modules dispatched actions is not ment to update the state of the store in nRF core, but a local store in the module ( like ble or RSSI), please say so.
I'm trying to build a new module based on the boilerplate, but i can't find the place where the module/boilerplate reducers are imported and combined into a rootReducer to create the store. (the index.js combines and exports yes, but where is the import of this export??)
In nRF core there is a function decorateReducer [1] which contains the command:
const appReducerFn = app[method]; // i think this is selecting the exported rootReducer from the app?
The app variable is defined in the function loadModule [2] with the command:
window.require(modulePath); //imports all the javascript files in the path. Right?[3]
These variables is imported and creates a store i the nRF Connect core.
Maybe it is something i'm missing, but this does not explain things for me. Where is the import of the exportet rootReducer in the module?
:)
[0] github.com/.../pc-nrfconnect-core
[1] github.com/.../apps.js
[2] github.com/.../fileUtil.js
[3] http://requirejs.org/