UNPKG

react-sweet-state

Version:

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

8 lines (7 loc) 344 B
import React from 'react'; import { defaultRegistry } from './store'; // Provide static calculateChangedBit to opt-out from context updates // as we use our own subscription model export const Context = /*#__PURE__*/React.createContext({ globalRegistry: defaultRegistry, retrieveStore: Store => defaultRegistry.getStore(Store) }, () => 0);