@@ -3,8 +3,15 @@ export const createStore = (initial, actions = {}) => {
const hooks = {};
const mergeState = newState => {
- // TODO
- }
+ Object.entries(newState).forEach(([key, newValue]) => {
+ const obs = store[key];
+ if (obs) {
+ obs._set(newValue);
+ } else {
+ // TODO
+ }
+ });
+ };
mergeState(initial);