unihooks
unihooks copied to clipboard
Universal unreacted hooks
In some reason wishbox cart URL hangs
Can be useful to indicate loading state. That is incurred by gotcha from wishbox - we need to initialize cart with experiences, after the experiences are loaded. For that matter...
Mutating objects outside of `setState` can cause weird effects. Ideally internal state must be frozen in `useStore`.
Used in context of web-server, it can provide hooks for a path handler. ```js function handler (req) { let [{ headers }] = useRequest('./some/path') return resp } ```
Live binding to current date value
`useMediaEffect(fn, mediaCondition)` `useToggleEffect(fn, boolean)` `useFSMEffect(states, value)` `useEffect(fn, deps, scheduler?)` Technically can be decomposed to `useState` + regular `useEffect`
https://github.com/chase-moskal/omnistorage
https://github.com/chase-moskal/crosscall
Must `useInput(name)` create ref, if no corresponding element found? ```js let [ref, setValue] = useInput(name) ``` Nope, `value` must be first, ref is an argument. But what if combine value...
#### [react-query](https://github.com/tannerlinsley/react-query) ```js function Todos() { const { data, isLoading, error } = useQuery('todos',async () => {const res = await fetch(...args) return await res.json()}) return ( {isLoading ? ( Loading......