Svelte """Hooks"""
Examples of how to achieve drop-in functionality with Svelte. Something like React Hooks. Should be easy to use - just drop into any of your components.
Whether the same level of composability as React Hooks can be achieved easily is an open question (to me, at least). Examples may or may not endeavor to be composable. See https://github.com/ryanatkn/assorted-svelte-tidbits/blob/master/tidbits/composing-svelte-stores-vs-react-hooks.md
Avoid examples which involve proper nouns like Redux or Firebase, and/or which seem to solve React-specific problems (forms, etc).
Perform action when user clicks outside of component.
todo
e.g. simply isScreenWide?
Just Fetch which tells you if it's loading.
todo
Track mouse position.
Like https://github.com/dogfessional/react-swipeable
todo
Easily store something in localstorage.
See https://twitter.com/Rich_Harris/status/1126688034223579140
- Rich Harris v1 https://codesandbox.io/s/630402kl3
- Rich Harris v2 (composable?) https://codesandbox.io/s/mqrl625xpj
Read and write to user's clipboard.
todo
e.g., update navigation header based on. Like https://github.com/Purii/react-use-scrollspy
todo
Like https://github.com/xxhomey19/use-undo
todo
Timer with start, stop, pause, reset
todo
Tracks if user is idle
todo
Logs during component's lifecycle methods
Create a debounced version of a function. Like https://github.com/streamich/react-use/blob/master/docs/useDebounce.md
todo