Async State Management without the Management
APACHE-2.0 License
Bot releases are visible (Hide)
Published by github-actions[bot] about 1 year ago
c8c5575e5a: Add 'paginationField' parameter to RestEndpoint and createResource
This adds a 'getPage' member; similar to getList.push/unshift but for pagination.
const TodoResource = createResource({
path: '/todos/:id',
schema: Todo,
paginationField: 'page',
}).getList.getPage({ page: '2' });
c8c5575e5a: Fix case where sometimes paginating would not update a collection
This was due to the comparison not using string serialization (canonical form for collection comparisons)
c8c5575e5a: Ignore 'undefined' parameters in collection matching
Updated dependencies [c8c5575e5a]
Updated dependencies [c8c5575e5a]
Updated dependencies [c8c5575e5a]
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
c8c5575e5a: Add 'paginationField' parameter to RestEndpoint and createResource
This adds a 'getPage' member; similar to getList.push/unshift but for pagination.
const TodoResource = createResource({
path: '/todos/:id',
schema: Todo,
paginationField: 'page',
}).getList.getPage({ page: '2' });
c8c5575e5a: Fix case where sometimes paginating would not update a collection
This was due to the comparison not using string serialization (canonical form for collection comparisons)
c8c5575e5a: Ignore 'undefined' parameters in collection matching
Updated dependencies [c8c5575e5a]
Updated dependencies [4e9d34ebc1]
Published by github-actions[bot] about 1 year ago
c8c5575e5a: Ignore 'undefined' parameters in collection matching
4e9d34ebc1: Optimistic creates no longer need a 'fake pk'
e.g.,
controller.fetch(TodoResource.getList.push, {
// id: randomId(), THIS IS NO LONGER NEEDED
userId,
title: e.currentTarget.value,
});
This is achieved by computing a random id when a pk cannot be
computed. In development mode non-create endpoints will
still throw when pk fails.
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
6fd842e464: Add controller.expireAll() that sets all responses to STALE
controller.expireAll(ArticleResource.getList);
This is like controller.invalidateAll(); but will continue showing
stale data while it is refetched.
This is sometimes useful to trigger refresh of only data presently shown
when there are many parameterizations in cache.
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
6fd842e464: Add controller.expireAll() that sets all responses to STALE
controller.expireAll(ArticleResource.getList);
This is like controller.invalidateAll(); but will continue showing
stale data while it is refetched.
This is sometimes useful to trigger refresh of only data presently shown
when there are many parameterizations in cache.
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
6fd842e464: Add controller.expireAll() that sets all responses to STALE
controller.expireAll(ArticleResource.getList);
This is like controller.invalidateAll(); but will continue showing
stale data while it is refetched.
This is sometimes useful to trigger refresh of only data presently shown
when there are many parameterizations in cache.
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
6fd842e464: Add controller.expireAll() that sets all responses to STALE
controller.expireAll(ArticleResource.getList);
This is like controller.invalidateAll(); but will continue showing
stale data while it is refetched.
This is sometimes useful to trigger refresh of only data presently shown
when there are many parameterizations in cache.
Published by github-actions[bot] about 1 year ago
51b4b0d188: Deprecate Resource.create
51b4b0d188: Add Resource.extend()
This is polymorphic, and has three forms
Set any field based on arguments:
Resource.extend('fieldName', { path: 'mypath/:id' });
Override any of the provided endpoints with options:
Resource.extend({
getList: {
path: 'mypath/:id',
},
update: {
body: {} as Other,
},
});
Function to compute derived endpoints:
Resource.extend(base => ({
getByComment: base.getList.extend({
path: 'repos/:owner/:repo/issues/comments/:comment/reactions',
}),
}));
Idea credits: @Dav3rs
51b4b0d188: Remove createResource pagination field in favor of getList.paginated
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
51b4b0d188: Deprecate Resource.create
51b4b0d188: Add Resource.extend()
This is polymorphic, and has three forms
Set any field based on arguments:
Resource.extend('fieldName', { path: 'mypath/:id' });
Override any of the provided endpoints with options:
Resource.extend({
getList: {
path: 'mypath/:id',
},
update: {
body: {} as Other,
},
});
Function to compute derived endpoints:
Resource.extend(base => ({
getByComment: base.getList.extend({
path: 'repos/:owner/:repo/issues/comments/:comment/reactions',
}),
}));
Idea credits: @Dav3rs
51b4b0d188: Remove createResource pagination field in favor of getList.paginated
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago