React's version of promistate now allows passing a dependencies array to update the callback in case it depends on local state (same as React's useCallback
).
const [search, setSearch] = React.useState('')
usePromistate(() => fetchArticles(search), {}, [search])
Additionally, some types have been improved.