Skip to content

Commit 1b37db6

Browse files
authored
Merge pull request #194 from atomic-state/fixes/mutate
Fixes/mutate
2 parents 04e2904 + 845d81d commit 1b37db6

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "http-react",
3-
"version": "3.6.4",
3+
"version": "3.6.6",
44
"description": "React hooks for data fetching",
55
"main": "dist/index.js",
66
"scripts": {

src/hooks/use-fetch.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -980,8 +980,9 @@ export function useFetch<FetchDataType = any, BodyType = any>(
980980

981981
if (isMutating) {
982982
if (serialize($data) !== serialize(cacheForMutation.get(resolvedKey))) {
983-
cacheForMutation.set(idString, data)
983+
cacheForMutation.set(idString, $data)
984984
if (isMutating) {
985+
forceMutate($data)
985986
if (handleMutate) {
986987
if (url === '') {
987988
;(onMutate as any)($data, imperativeFetch)

src/utils/shared.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ export function $searchParams<T = any>(input: string) {
194194

195195
const parsedParams = new Map()
196196

197-
// @ts-expect-error
198197
for (let key of allKeys) {
199198
const allValues = searchParams.getAll(key)
200199

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"target": "ES5",
3+
"target": "ES2015",
44
"outDir": "./dist",
55
"module": "CommonJS",
66
"lib": ["es6", "dom", "es2019"],

0 commit comments

Comments
 (0)