UNPKG

react-sweet-state

Version:

Global + local state combining the best of Redux and Context API

14 lines (12 loc) 358 B
import React from 'react'; const defaultMutator = (prevState, partialState) => { // Merge the partial state and the previous state. return Object.assign({}, prevState, partialState); }; const defaults = { batchUpdates: 'useSyncExternalStore' in React, devtools: false, middlewares: new Set(), mutator: defaultMutator }; export default defaults;