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