Releases: reactive/data-client
@data-client/test@0.14.16
Patch Changes
-
#3238
28b702d
Thanks @ntucker! - Add renderDataHook() exportThis can be used instead of
makeRenderDataHook(DataProvider)
import { renderDataHook } from '@data-client/test'; const { result, waitFor } = renderDataHook( () => { return useSuspense(ArticleResource.get, { id: 5 }); }, { initialFixtures: [ { endpoint: ArticleResource.get, args: [{ id: 5 }], response, }, ], }, );
-
#3244
109c922
Thanks @ntucker! - Support actionTypes without _TYPE suffix -
#3238
28b702d
Thanks @ntucker! - makeRenderDataClient() -> makeRenderDataHook() (but keep the old name still)
@data-client/rest@0.14.16
Patch Changes
-
#3243
43a955c
Thanks @ntucker! -schema.Entity
-> EntityMixinimport { EntityMixin } from '@data-client/rest'; export class Article { id = ''; title = ''; content = ''; tags: string[] = []; } export class ArticleEntity extends EntityMixin(Article) {}
We keep
schema.Entity
for legacy, and add schema.EntityMixin and EntityMixin as direct export -
Updated dependencies [
4580e62
,1f7b191
,43a955c
]:- @data-client/endpoint@0.14.16
@data-client/react@0.14.16
Patch Changes
-
#3244
109c922
Thanks @ntucker! - Add actionTypes without _TYPE suffix(Not breaking - we keep the old actionTypes name as well.)
import type { Manager, Middleware } from '@data-client/react'; import { actionTypes } from '@data-client/react'; export default class LoggingManager implements Manager { middleware: Middleware = controller => next => async action => { switch (action.type) { case actionTypes.SET_RESPONSE_TYPE: console.info( `${action.endpoint.name} ${JSON.stringify(action.response)}`, ); default: return next(action); } }; cleanup() {} }
import type { Manager, Middleware } from '@data-client/react'; import { actionTypes } from '@data-client/react'; export default class LoggingManager implements Manager { middleware: Middleware = controller => next => async action => { switch (action.type) { case actionTypes.SET_RESPONSE: console.info( `${action.endpoint.name} ${JSON.stringify(action.response)}`, ); default: return next(action); } }; cleanup() {} }
-
Updated dependencies [
109c922
]:- @data-client/core@0.14.16
@data-client/normalizr@0.14.16
Patch Changes
- #3243
43a955c
Thanks @ntucker! - Update README to link to EntityMixin
@data-client/graphql@0.14.16
Patch Changes
-
#3243
43a955c
Thanks @ntucker! -schema.Entity
-> EntityMixinimport { EntityMixin } from '@data-client/rest'; export class Article { id = ''; title = ''; content = ''; tags: string[] = []; } export class ArticleEntity extends EntityMixin(Article) {}
We keep
schema.Entity
for legacy, and add schema.EntityMixin and EntityMixin as direct export -
Updated dependencies [
4580e62
,1f7b191
,43a955c
]:- @data-client/endpoint@0.14.16
@data-client/endpoint@0.14.16
Patch Changes
-
#3243
43a955c
Thanks @ntucker! -schema.Entity
-> EntityMixinimport { EntityMixin } from '@data-client/rest'; export class Article { id = ''; title = ''; content = ''; tags: string[] = []; } export class ArticleEntity extends EntityMixin(Article) {}
We keep
schema.Entity
for legacy, and add schema.EntityMixin and EntityMixin as direct export
@data-client/core@0.14.16
Patch Changes
-
#3244
109c922
Thanks @ntucker! - Add actionTypes without _TYPE suffix(Not breaking - we keep the old actionTypes name as well.)
import type { Manager, Middleware } from '@data-client/react'; import { actionTypes } from '@data-client/react'; export default class LoggingManager implements Manager { middleware: Middleware = controller => next => async action => { switch (action.type) { case actionTypes.SET_RESPONSE_TYPE: console.info( `${action.endpoint.name} ${JSON.stringify(action.response)}`, ); default: return next(action); } }; cleanup() {} }
import type { Manager, Middleware } from '@data-client/react'; import { actionTypes } from '@data-client/react'; export default class LoggingManager implements Manager { middleware: Middleware = controller => next => async action => { switch (action.type) { case actionTypes.SET_RESPONSE: console.info( `${action.endpoint.name} ${JSON.stringify(action.response)}`, ); default: return next(action); } }; cleanup() {} }
-
Updated dependencies [
43a955c
]:- @data-client/normalizr@0.14.16
@data-client/img@0.14.15
@data-client/react@0.14.14
Patch Changes
-
#3220
13f02d3
Thanks @ntucker! - New useDebounce() in /next that integrates useTransition()import { useDebounce } from '@data-client/react/next'; const [debouncedQuery, isPending] = useDebounce(query, 100);
- Returns tuple - to include isPending
- Any Suspense triggered due to value change will continue showing
the previous contents until it is finished loading.
@data-client/rest@0.14.13
Patch Changes
- #3215
e74f7dc
Thanks @renovate! - Update path-to-regexp for CVE-2024-45296