Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[breaking] Remove useCacheLegacy() and useResourceLegacy() #170

Merged
merged 1 commit into from
Nov 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions docs/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ title: API Reference

## Hooks
- [useResource](useResource.md)
- [useResourceLegacy](useResourceLegacy.md)
- [useFetcher](useFetcher.md)
- [useCache](useCache.md)
- [useCacheLegacy](useCacheLegacy.md)
- [useSubscription](useSubscription.md)
- [useRetrieve](useRetrieve.md)
- [useInvalidator](useInvalidator.md)
Expand Down
62 changes: 0 additions & 62 deletions docs/api/useCacheLegacy.md

This file was deleted.

105 changes: 0 additions & 105 deletions docs/api/useResourceLegacy.md

This file was deleted.

6 changes: 0 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
Schema,
SchemaList,
SchemaDetail,
SchemaOf,
schemas,
} from './resource';
import NetworkManager from './state/NetworkManager';
Expand All @@ -20,11 +19,9 @@ import reducer, { initialState } from './state/reducer';
import { useDenormalized } from './state/selectors';
import {
useCache,
useCacheLegacy,
useFetcher,
useRetrieve,
useResource,
useResourceLegacy,
useSubscription,
useMeta,
useError,
Expand Down Expand Up @@ -84,7 +81,6 @@ export type State<T> = State<T>;
export type Schema = Schema;
export type SchemaList<T> = SchemaList<T>;
export type SchemaDetail<T> = SchemaDetail<T>;
export type SchemaOf<T> = SchemaOf<T>;
export type AbstractInstanceType<T> = AbstractInstanceType<T>;
export type FetchOptions = FetchOptions;
export type Method = Method;
Expand Down Expand Up @@ -116,13 +112,11 @@ export {
CacheProvider,
ExternalCacheProvider,
useCache,
useCacheLegacy,
useFetcher,
useRetrieve,
useInvalidator,
useResetter,
useResource,
useResourceLegacy,
useSubscription,
useMeta,
useError,
Expand Down
116 changes: 0 additions & 116 deletions src/react-integration/__tests__/__snapshots__/hooks.tsx.snap
Original file line number Diff line number Diff line change
@@ -1,47 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`useCacheLegacy should select paginated results 1`] = `
Array [
PaginatedArticleResource {
"author": null,
"content": "the best things in life com efree",
"id": 23,
"tags": Array [
"one",
"two",
],
"title": "the first draft",
},
PaginatedArticleResource {
"author": null,
"content": "the best things in life com efree",
"id": 44,
"tags": Array [
"hbh",
"wew",
],
"title": "the second book",
},
PaginatedArticleResource {
"author": null,
"content": "the best things in life com efree",
"id": 2,
"tags": Array [
"free",
"honey",
],
"title": "the third novel",
},
PaginatedArticleResource {
"author": null,
"content": "the best things in life com efree",
"id": 643,
"tags": Array [],
"title": "a long time ago",
},
]
`;

exports[`useFetcher should dispatch an action that fetches a create 1`] = `
Object {
"meta": Object {
Expand Down Expand Up @@ -169,80 +127,6 @@ Object {
}
`;

exports[`useResourceLegacy() should dispatch an action that fetches 1`] = `
Object {
"meta": Object {
"options": undefined,
"reject": [Function],
"resolve": [Function],
"responseType": "rest-hooks/receive",
"schema": EntitySchema {
"_getId": [Function],
"_idAttribute": [Function],
"_key": "http://test.com/article-cooler/",
"_mergeStrategy": [Function],
"_processStrategy": [Function],
"denormalize": [Function],
"schema": Object {},
},
"throttle": true,
"url": "GET http://test.com/article-cooler/5",
},
"payload": [Function],
"type": "rest-hooks/fetch",
}
`;

exports[`useResourceLegacy() should dispatch fetch when sent multiple arguments 1`] = `
Object {
"meta": Object {
"options": undefined,
"reject": [Function],
"resolve": [Function],
"responseType": "rest-hooks/receive",
"schema": EntitySchema {
"_getId": [Function],
"_idAttribute": [Function],
"_key": "http://test.com/article-cooler/",
"_mergeStrategy": [Function],
"_processStrategy": [Function],
"denormalize": [Function],
"schema": Object {},
},
"throttle": true,
"url": "GET http://test.com/article-cooler/5",
},
"payload": [Function],
"type": "rest-hooks/fetch",
}
`;

exports[`useResourceLegacy() should dispatch fetch when sent multiple arguments 2`] = `
Object {
"meta": Object {
"options": undefined,
"reject": [Function],
"resolve": [Function],
"responseType": "rest-hooks/receive",
"schema": Array [
EntitySchema {
"_getId": [Function],
"_idAttribute": [Function],
"_key": "http://test.com/user/",
"_mergeStrategy": [Function],
"_processStrategy": [Function],
"denormalize": [Function],
"schema": Object {},
},
],
"throttle": true,
"url": "GET http://test.com/user/",
},
"payload": [Function],
"type": "rest-hooks/fetch",
}
`;

exports[`useRetrieve should dispatch singles 1`] = `
Object {
"meta": Object {
Expand Down
Loading