UNPKG

@mui/x-charts

Version:

The community edition of the Charts components (MUI X).

6 lines 402 B
import { useSyncExternalStoreWithSelector } from 'use-sync-external-store/with-selector'; const defaultCompare = Object.is; export const useSelector = (store, selector, args = undefined, equals = defaultCompare) => { const selectorWithArgs = state => selector(state, args); return useSyncExternalStoreWithSelector(store.subscribe, store.getSnapshot, store.getSnapshot, selectorWithArgs, equals); };