Releases: Jcparkyn/phetch
Releases · Jcparkyn/phetch
v0.1.2
v0.1.1
Changes
Query.Cancel()
now causes the query state to change immediately, rather than waiting for the query function to throw aTaskCanceledException
.
New Features
- Added a
PrefetchAsync
method toEndpoint
, which can be used to fetch data ahead of time. - Added new overloads for
Endpoint
constructors which don't require aCancellationToken
to be passed. - Added a
Trigger()
method toQuery<T>
that doesn't require an argument to be passed.
Bugfixes
- Fixed a bug which caused
Cancel()
to result in a query error if the cancellation didn't happen synchronously.
v0.1.0
This release removes the concept of mutations as the previously existed, and instead combines the previous functionality of mutations into the Query
class. This is a very significant change, but future releases should contain far fewer breaking changes.
BREAKING CHANGES:
- Removes the existing
Mutation
andMutationEndpoint
classes.- You can now just use the standard
Query
classes, and callTrigger
instead ofSetArg
to get the same functionality.
- You can now just use the standard
- Replaces
QueryEndpoint
withEndpoint
,ParameterlessEndpoint
, and 'MutationEndpoint` (depending on the shape of the query function). - Replaces
UseQueryEndpoint
withUseEndpoint
,UseParameterlessEndpoint
, and 'UseMutationEndpoint`. - Renames
SetParam
toSetArg
.
New Features
- Mutations now have all the same features as queries, including caching, cache updates/invalidation, and cancellation.
- Adds
OnSuccess
/OnFailure
options to both queries and endpoints. - Adds support for
CancellationToken
across the entire library. - Adds a
Skip
parameter toUseEndpoint
, for conditional fetching. - Lots of extra documentation.
Other Changes
- Fixes bugs involving the handling of out-of-order query returns.
- Fixes bugs causing double-fetching
- Fixes bugs causing unnecessary double-rendering of Blazor components.
- Adds lots of automated tests.
- Significantly improves the README.