mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
11 lines
452 B
JavaScript
11 lines
452 B
JavaScript
import { useSelector } from "./use-selector.js";
|
|
import { identity, noop } from "@videojs/utils/function";
|
|
//#region src/react/hooks/use-store.ts
|
|
const noopSubscribe = () => noop;
|
|
function useStore(store, selector, isEqual) {
|
|
return useSelector(selector ? (cb) => store.subscribe(cb) : noopSubscribe, selector ? () => store.state : () => store, selector ?? identity, isEqual);
|
|
}
|
|
//#endregion
|
|
export { useStore };
|
|
|
|
//# sourceMappingURL=use-store.js.map
|