- Introduce support for endpoints that do not respond with
result.total
orresult.total
as -1 when usingallPages: true
to indicate that the endpoint is not counting the total available results, instead figbird will keep paging over the API until all data is gathered - Introduce a new option
parallelLimit
touseFind
to limit max number of requests, default value is 4 - Introduce a new option on
Provider
fordefaultPageSize
anddefaultPageSizeWhenFetchingAll
- Upgrade all dependencies to address security alerts.
- Upgrade all dependencies to address security alerts.
- Upgrade all dependencies to address security alerts.
- Rewrite internals for useQuery to address several issues and simplify the code
- Reduce the internal states in useQuery to reduce number of re-renders
- Fix an issue where cache-first would refetch when params changed
- Fix an issue where multi operations in useMutation (e.g. creating an array of items) would not correctly update the cache after completing
- Switch the cache store from
tiny-atom
tokinfolk
. Breaking change if you're relying on using the cache directly. Refer to [kinfolk
](https://github.com/KidkArolis/kinfolk/ documentation] for how to consume the new cache. - Remove the deprecated
loading: boolean
andreloading: boolean
fromuseFind
anduseGet
result - usestatus: string
andisFetching: boolean
instead. - Upgrade all dependencies.
- Upgrade all dependencies to address security alerts.
- Upgrade all dependencies to address security alerts.
- Upgrade all dependencies.
- Replace babel with swc.
- Fix an issue with
parallel: true
where it wasn't always fetching the last page of data.
- Add
parallel: true
option to useFind to use in combination withallPages: true
that fetches all pages (after the 1st one) in parallel, resulting in faster page loads for when multiple pages need to be fetched.
- Fix: when skip is set to
true
, return data asnull
even if there's cached data available.
- Add support for multi remove, in addition to multi create.
- Add support for multi operations. E.g. multi create result, which is an array, now gets correctly incorporated into the cache.
- Do not dispatch mutation
success
/error
if the component is unmounted - Upgrade all dependencies
- The return values of
useGet
,useFind
anduseMutation
are now wrapped inuseMemo
. This means they don't change between renders unless some of the keys changed. - Functions
create
,update
,patch
,remove
are now wrapped inuseCallback
. This means they don't change between renders.
- Fix bad
packafge.json#main
field.
No breaking changes! But some things have been deprecated and new options have been added.
- Add
fetchPolicy
option touseGet
anduseFind
:swr
- show cached data if possible and refetch in the backgroundcache-first
- show cached data if possible without refetchingnetwork-only
- always refetch the data on mount
- Add
realtime
option touseGet
anduseFind
:merge
- merge realtime events into cached queries as they comerefetch
- refetch the query when realtime event is receiveddisabled
- do not update cached data on realtime events
- Add
status
andisFetching
that supersedesloading
andreloading
boolean flags, which are still there but are now deprecated. ForuseGet/useFind
status can be one ofloading | success | error
and foruseMutation
it'sidle | loading | success | error
- Add
data
inuseMutation
return value, which holds the result of last successful mutation - Log a warning if an item doesn't have an ID to help identify a misconfigured
idField
- Add
matcher
option touseGet
anduseFind
for customising how objects get matched against queries, e.g. useful if you use a custom filter or operation and want to handle that correctly client side - Remove dependency on
@feathersjs/adapter-commons
reducing the bundle size
- Add new option
updatedAtField
, similar toidField
it is used to extract theupdatedAt
value of an entity to know if the entity is newer or older than what's in the cache. This is to avoid overwriting older data with newer data when a get request is racing with a realtime update. - Fix an issue with disposing the realtime event listeners. Previously, realtime event listeners were not always being disposed of, depending on the order in which components were rendered and unrendered.
- Fix an issue where updating the query in
useFind
call would put theuseFind
into incorrect state with datanull
and loadingfalse
. Now, in such situations,loading
(andreloading
) will be set to true to correctly indicate that updated query is not cached and data is being fetched. - Fix error
useGet
anduseFind
error handling
- Fix an issue with removing realtime event listeners, chaining
.off()
doesn't work in Feathers (See feathersjs/feathers#1704). This meant that when component withuseFind
was rendered in and out multiple times, the realtime event listeners were never being removed.
- Add
allPages
option to fetch all pages of the given resource - Reuse in flight requests when identical (same id for get and same params hash for find)
- Add
refetch
inuseFind
anduseGet
to allow imperatively reloading the data
- Add dependencies to
useSelector
, otherwise wrong old closed over params are used. This meant that if say you change query, the oldhashedQuery
id was being used, returning wrong data inuseFind
- Fix mutations from failing when no query object is used
- Fix
skip
option - do not fetch data when skip option is passed in touseFind
oruseGet
- Add
idField
option to Provider. By default look for bothid
and then_id
- both common in Feathers applications.
- Improve realtime event listeners to work with multiple components using the same service. Previously, as soon as the component unmounts, we'd stop listening. Now, the realtime event listeners will remain active while there's at least one component connected to the given service.
- Do not add entities to cache from
created
events if they're note relevant to any queries. This avoids server events growing the cache size without any benefit to the client.
- Figbird hatched 🐣. Fully functional first version of the library.