src/store/Store.js
/**
   * Replaces the state for only the keys in the updated state. Notifies all listeners of state change.
   * @param {object} state the new (partial) redux state
   */
Replaces the state for only the keys in the updated state. Notifies all listeners of state change.
@param {object} state the new (partial) redux state
Replaces the state for only the keys in the updated state . Notifies all listeners of state change . @param { object } state the new ( partial ) redux state
patchState(difference) {
    const state = Object.assign({}, this.state);
    difference.forEach(({ change, key, value }) => {
      switch (change) {
        case DIFF_STATUS_UPDATED:
          state[key] = value;
          break;
        case DIFF_STATUS_REMOVED:
          Reflect.deleteProperty(state, key);
          break;
        default:
      }
    });
    this.state = state;
    this.listeners.forEach((l) => l());
  }
patchState ( difference ) { const state = Object . assign ( { } , this . state ) ; difference . forEach ( ( { change , key , value } ) => { switch ( change ) { case DIFF_STATUS_UPDATED : state [ key ] = value ; break ; case DIFF_STATUS_REMOVED : Reflect . deleteProperty ( state , key ) ; break ; default : } } ) ; this . state = state ; this . listeners . forEach ( ( l ) => l ( ) ) ; }
Replaces the state for only the keys in the updated state.
Replaces the state for only the keys in the updated state .
// console.log('diff in store', difference) // do nothing