Skip to content

Commit

Permalink
Use lodash instead of merge-deep
Browse files Browse the repository at this point in the history
  • Loading branch information
compulim committed Feb 6, 2024
1 parent 29c507d commit 0d89841
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 178 deletions.
179 changes: 6 additions & 173 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions packages/use-schema-org-action/package.json
Expand Up @@ -71,7 +71,6 @@
"@tsconfig/strictest": "^2.0.2",
"@types/jest": "^29.5.11",
"@types/lodash": "^4.14.202",
"@types/merge-deep": "^3.0.3",
"@types/node": "^20.10.4",
"@types/react": "^18.2.45",
"esbuild": "^0.19.9",
Expand All @@ -91,9 +90,8 @@
"dependencies": {
"@babel/runtime-corejs3": "^7.23.6",
"lodash": "^4.17.21",
"merge-deep": "^3.0.3",
"prop-types": "^15.8.1",
"use-state-with-ref": "^0.0.1",
"valibot": "^0.28.0"
"valibot": "^0.27.1"
}
}
4 changes: 2 additions & 2 deletions packages/use-schema-org-action/src/useSchemaOrgAction.ts
@@ -1,4 +1,4 @@
import mergeDeep from 'merge-deep';
import merge from 'lodash/merge';
import { useCallback, useEffect, useMemo, useRef, type Dispatch, type SetStateAction } from 'react';
import { useStateWithRef } from 'use-state-with-ref';
import { parse, safeParse, type Output } from 'valibot';
Expand Down Expand Up @@ -60,7 +60,7 @@ export default function useSchemaOrgAction<

if (!abortController.signal.aborted) {
setAction(
action => mergeDeep({ ...action, actionStatus: 'CompletedActionStatus' }, response) as ActionWithActionStatus<T>
action => merge({}, action, { actionStatus: 'CompletedActionStatus' }, response) as ActionWithActionStatus<T>
);
}
}, [actionRef, handler, initialActionRef, inputSchema, outputSchema, setAction]);
Expand Down

0 comments on commit 0d89841

Please sign in to comment.