dy / unihooks

Universal unreacted hooks
MIT License
21 stars 1 forks source link

useStore #7

Closed dy closed 4 years ago

dy commented 4 years ago

High-level store/persistency provider.

let [ value, setValue ] = useStore(key, initialValue, { persist: true|'localStorage'|'queryString'|'attribute'|fn })
dy commented 4 years ago

That possibly can be spect hook, coupled with storage aspect. Same is for useAction hook - they make not much sense as own abstraction.

dy commented 4 years ago

Does not make much sense for it to implement BroadcastChannel - usual case is just storing data. If data have to be broadcast live - use useChannel for that purpose.

dy commented 4 years ago

Done!