oyvindberg / use-remote-data

Promise handling for react. Principled, Boilerplate-free, Caching, Invalidating

Home Page:https://oyvindberg.github.io/use-remote-data/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Consider enabling callbacks provided to `WithRemoteData

oyvindberg opened this issue · comments

    Would  it make sense to have `onPending` and `onError` callback props as well?

Originally posted by @jestho in #2 (comment)

It would make a lot of sense, but I'll defer the decision.

The () => Promise<T> function passed to useRemoteData is currently the place to put those callbacks, and there is some value in having few ways of expressing the same think.

Should at least go in documentation though.