Download node_modules/@tanstack/react-store/dist/useSelector.d.cts from sitcod3/modul-s: direct link, hf CLI and curl.
- Browser
- Download file 1.09 kB
-
https://huggingface.co/spaces/sitcod3/modul-s/resolve/c06e4783a2be21cd7ca9fedf1ede4d4f0156ba3a/node_modules/%40tanstack/react-store/dist/useSelector.d.cts
- Command line
-
hf download hf://spaces/sitcod3/modul-s@c06e4783a2be21cd7ca9fedf1ede4d4f0156ba3a/node_modules/@tanstack/react-store/dist/useSelector.d.cts
-
curl -L -o useSelector.d.cts https://huggingface.co/spaces/sitcod3/modul-s/resolve/c06e4783a2be21cd7ca9fedf1ede4d4f0156ba3a/node_modules/%40tanstack/react-store/dist/useSelector.d.cts
1.09 kB
| //#region src/useSelector.d.ts | |
| interface UseSelectorOptions<TSelected> { | |
| compare?: (a: TSelected, b: TSelected) => boolean; | |
| } | |
| type SelectionSource<T> = { | |
| get: () => T; | |
| subscribe: (listener: (value: T) => void) => { | |
| unsubscribe: () => void; | |
| }; | |
| }; | |
| /** | |
| * Selects a slice of state from an atom or store and subscribes the component | |
| * to that selection. | |
| * | |
| * This is the primary React read hook for TanStack Store. It works with any | |
| * source that exposes `get()` and `subscribe()`, including atoms, readonly | |
| * atoms, stores, and readonly stores. | |
| * | |
| * Omit the selector to subscribe to the whole value. | |
| * | |
| * @example | |
| * ```tsx | |
| * const count = useSelector(counterStore, (state) => state.count) | |
| * ``` | |
| * | |
| * @example | |
| * ```tsx | |
| * const value = useSelector(countAtom) | |
| * ``` | |
| */ | |
| declare function useSelector<TSource, TSelected = NoInfer<TSource>>(source: SelectionSource<TSource>, selector?: (snapshot: TSource) => TSelected, options?: UseSelectorOptions<TSelected>): TSelected; | |
| //#endregion | |
| export { UseSelectorOptions, useSelector }; | |
| //# sourceMappingURL=useSelector.d.cts.map |