dy / unihooks

Universal unreacted hooks
MIT License
21 stars 1 forks source link

useResource #29

Open dy opened 4 years ago

dy commented 4 years ago

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 we could wait for experiences condition in reactive aspect, and once they're loaded - that'd trigger initialization.

let [data, {loading}] = useResource(someSource)

That can be akin to useAsyncSource