Closed jcperez-ch closed 8 years ago
To assure immutability, we might need to leverage the use of Object.freeze every time we merge a new state.
We need to make sure as well that we can create nested namespaces like:
// user.js flaxs.createReducer('user', (state, payload) => {}, { info: {}});
and
// userPreferences.js flaxs.createReducer('user.preferences', (state, payload) => {}, { language: 'en', locale: 'en-CA' });
and at the end have a deep immutable state like:
{ "user": { "info": {}, "preferences": { "language": "en", "locale": "en-CA" } } }
I would also consider implementing a library like Immutable.js to make sure any data coming from the store cannot be altered.
Immutable.js
Fixed in https://github.com/jcperez-ch/flaxs/pull/3
To assure immutability, we might need to leverage the use of Object.freeze every time we merge a new state.
We need to make sure as well that we can create nested namespaces like:
and
and at the end have a deep immutable state like: