A simple, declarative, and composable way to fetch data for React components
OTHER License
Bot releases are hidden (Show)
Published by ryanbrainard over 7 years ago
Published by ryanbrainard over 7 years ago
Published by ryanbrainard over 7 years ago
fetch
implementation. Auto-detects default fetch
including client and server side implementations.whatwg-fetch
as a peer dependency.connect.defaults()
function to set options and default values for request mappings. Includes type checking of defaults. [docs]buildRequest
, fetch
, and handle Response
implementations in connect.defaults()
or in mapping definitions. [docs]options
argument in connect
. Applications that use withRef
as an option (i.e. connect(props, { withRef: true })
) should change to using connect.defaults
(i.e. connect.defaults({ withRef: true })(props)
).props
and context
during componentWillReceiveProps
and only recalculate mappings and refetch if props
and context
actually changed.connect
-only level options from defaults()
to options()
. All request attributes can now be supplied in defaults()
or individual requests.PromiseState.resolve
to return value
as-is if it is already PromiseState
children
in willReceiveProps
comparisonpure
option allow apps to control always updating on prop changesthen
and catch
to return undefined
for side effectsrefreshing
to take a function to change value
before requestwrappedInstance
to the meta
object https://github.com/heroku/react-refetch/pull/139
PromiseState.refreshing
https://github.com/heroku/react-refetch/pull/150
PromiseState.refreshing
https://github.com/heroku/react-refetch/pull/150
wrappedInstance
to the meta
object https://github.com/heroku/react-refetch/pull/139
children
in willReceiveProps
comparisonpure
option allow apps to control always updating on prop changesthen
and catch
to return undefined
for side effectsrefreshing
to take a function to change value
before requestthen
and inherits fetch
, buildRequest
, Request
, and handleResponse
Thank you to @nfcampos for this contribution!
Published by ryanbrainard over 8 years ago
connect
-only level options from defaults()
to options()
. All request attributes can now be supplied in defaults()
or individual requests.context
parameter to work with connect
being used as a function (instead of a decorator)PromiseState.resolve
to return value
as-is if it is already PromiseState
Thanks to @nfcampos for his contributions to this release!
Published by ryanbrainard over 8 years ago
props
and context
during componentWillReceiveProps
and only recalculate mappings and refetch if props
and context
actually changed. This change maybe potentially breaking, but mapPropsToRequestsToProps
should have always been a pure function and should not impact apps that abided by that contract. Pull Request: https://github.com/heroku/react-refetch/pull/94
Thank you to @nfcampos for the contribution!
Published by ryanbrainard over 8 years ago
fetch
, handleResponse
, buildRequest
and Request
can now be set at the mapping levelSee https://github.com/heroku/react-refetch/pull/96 for more details.
Thank you to @nfcampos for the contribution!
Published by ryanbrainard over 8 years ago
fetch
implementation. Auto-detects default fetch
including client and server side implementations.whatwg-fetch
as a peer dependency.connect.defaults()
function to set options and default values for request mappings. Includes type checking of defaults. [docs]buildRequest
, fetch
, and handle Response
implementations in connect.defaults()
. [docs]options
argument in connect
. Applications that use withRef
as an option (i.e. connect(props, { withRef: true })
) should change to using connect.defaults
(i.e. connect.defaults({ withRef: true })(props)
).The features above were delivered in https://github.com/heroku/react-refetch/pull/76 by the amazing @passcod!
Published by ryanbrainard over 8 years ago
context
as second argument to mapPropsToRequestsToProps()
[docs]setState()
being called after component unmountsBig thanks @nfcampos's contributions for this release!
Published by ryanbrainard over 8 years ago
context
as second argument to mapPropsToRequestsToProps()
setState()
being called after component unmountsBig thanks @nfcampos's contributions for this release!
Published by ryanbrainard over 8 years ago
cause
field to errors in PromiseState.reason
to access raw object that caused the error