-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #69 from etherspot/fix/paymaster-prop-object-memoized
paymaster prop as memoized object
- Loading branch information
Showing
8 changed files
with
35 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ const external = [ | |
'ethers', | ||
'react', | ||
'buffer', | ||
'lodash', | ||
]; | ||
|
||
export default [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { useRef } from 'react'; | ||
import isEqual from 'lodash/isEqual'; | ||
|
||
const useDeepCompare = (value: any) => { | ||
const ref = useRef<any>(value); | ||
|
||
if (!isEqual(value, ref.current)) { | ||
ref.current = value; | ||
} | ||
|
||
return ref.current; | ||
} | ||
|
||
export default useDeepCompare; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { useMemo } from 'react'; | ||
import * as _ from 'lodash'; | ||
import uniqueId from 'lodash/uniqueId'; | ||
|
||
const useId = () => { | ||
return useMemo(() => _.uniqueId(), []); | ||
return useMemo(() => uniqueId(), []); | ||
}; | ||
|
||
export default useId; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters