Commit graph

27 commits

Author SHA1 Message Date
0f34ac9182 chore: fix use client response type 2021-06-24 21:59:15 +03:00
163822a49f feat: add clear request store 2021-06-23 02:31:42 +03:00
39d80815c9 refac!: change accessibility for request hook
BREAKING CHANGES:
now only endpoints with method without side-effects (HEAD, GET)
can be used in `useRequest` hook.

style: change type to interface
2021-06-23 02:14:20 +03:00
f109d87b41 refac: move abort controller to lazy request hook 2021-06-22 22:48:22 +03:00
acddd23634 fix: use force param only request hook 2021-06-18 01:01:30 +03:00
3c1582ef9f feat: add response to state 2021-06-17 22:43:29 +03:00
4ddc6fb420 fix: don't get json from error 2021-06-15 12:04:30 +03:00
6249d0bde9 fix: try to get json data from error 2021-06-15 00:11:58 +03:00
00308d6718 chore: some cosmetic changes 2021-05-16 23:19:02 +03:00
304611fb53 fix: typo in invariant 2021-05-16 23:18:41 +03:00
a1193cee47 style: rename files 2021-05-16 23:18:41 +03:00
7683c20a2e feat: add request cancelation
Closes #26
2020-12-23 05:16:03 +03:00
edc88a64ff fix: change default params type to unknown 2020-12-23 00:18:55 +03:00
beba6445a2 fix: extracting type conflicts 2020-12-23 00:03:45 +03:00
a1afb6b599 feat: add refetch function to hooks state
Closes #22
2020-12-19 17:03:49 +03:00
651e09bc31 feat: extract types from endpoint
chore: change example and readme

Closes #24
2020-12-19 13:26:22 +03:00
49aac94675 fix: use window location as base url
chore: add dist folder to repo
chore(deps): add node-fetch for tests
chore: change prepare request visibility
chore: add tests for prepare request method
chore: update example

Closes #20
2020-12-08 10:35:18 +03:00
c848b0c785 feat!: transform endpoint data before state
BREAKING CHANGES: Endpoint now required response, variables and
params types

Closes #3
2020-11-20 20:01:24 +03:00
b944725e07 chore: add is function helper 2020-11-20 19:44:02 +03:00
078b5c1a3a feat(endpoint): add head method
Closes #17
2020-11-20 19:09:29 +03:00
a66e10fc1a feat(request-hook): allow autofetching for...
POST, PUT, PATCH methods

Closes #13
2020-11-06 04:57:12 +03:00
132ae5c22c fix: filter undefined variable values
chore(tests): add tests for misc methods

Closes #14
2020-11-06 04:47:01 +03:00
7e8bc3d557 fix(request-hook): increase priority for handle...
configuration. Now `onComplete` callback in handle config
overwrite `onComplete` callback in hook config.

Closes #10
2020-11-06 01:02:21 +03:00
a1574769e9 feat(request-hook): add on failure callback
* fix(client): remove destruction from response
* chore: update example

Add single endpoint, add router, add pages

Closes #9
2020-11-06 00:58:43 +03:00
8c6833805b feat!(request-hook): add new request hook
This hook works only for endpoint with GET method.

* refac!(request-hook): add lazy prefix to request hook

BREAKING CHANGES: you need to rename all `useRequest` hooks to
`useLazyRequest`

* refac!(request-hook): add public request state

BREAKING CHANGES: User shouldn't see previous headers, variables and params.
It's only for hooks so it doesn't call request again. If you use these
state you should to remove it from your code.

* chore: update example

Closes #5
2020-11-05 23:26:56 +03:00
243f4f77e5 feat!(client): add client fetch based
breaking!(context): client prop instead base url
refac: change axios response to client response
chore(deps): remove axios
chore: update example

Closes #2
2020-11-05 00:23:57 +03:00
e9c18c9fea Initial commit
feat(context): add context for request
feat(client): add hook for get memo rest client
feat(endpoint): add endpoint object for configure rest methods
feat(request): add request hook
refac(request): return cached data for same query
refac(request): remove void variables for endpoints
feat(request): add headers to request cache
2020-11-04 00:39:14 +03:00