mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): revert back to lrumemoize
This commit is contained in:
parent
823edbfdef
commit
f5f378d04b
@ -1,32 +1,33 @@
|
|||||||
import {
|
import {
|
||||||
createDraftSafeSelectorCreator,
|
createDraftSafeSelectorCreator,
|
||||||
createSelectorCreator,
|
createSelectorCreator,
|
||||||
weakMapMemoize,
|
lruMemoize,
|
||||||
} from '@reduxjs/toolkit';
|
} from '@reduxjs/toolkit';
|
||||||
import type { GetSelectorsOptions } from '@reduxjs/toolkit/dist/entities/state_selectors';
|
import type { GetSelectorsOptions } from '@reduxjs/toolkit/dist/entities/state_selectors';
|
||||||
|
import { isEqual } from 'lodash-es';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A memoized selector creator that uses LRU cache and lodash's isEqual for equality check.
|
* A memoized selector creator that uses LRU cache and lodash's isEqual for equality check.
|
||||||
*/
|
*/
|
||||||
export const createMemoizedSelector = createSelectorCreator({
|
export const createMemoizedSelector = createSelectorCreator({
|
||||||
memoize: weakMapMemoize,
|
memoize: lruMemoize,
|
||||||
// memoizeOptions: {
|
memoizeOptions: {
|
||||||
// resultEqualityCheck: isEqual,
|
resultEqualityCheck: isEqual,
|
||||||
// },
|
},
|
||||||
argsMemoize: weakMapMemoize,
|
argsMemoize: lruMemoize,
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A memoized selector creator that uses LRU cache default shallow equality check.
|
* A memoized selector creator that uses LRU cache default shallow equality check.
|
||||||
*/
|
*/
|
||||||
export const createLruSelector = createSelectorCreator({
|
export const createLruSelector = createSelectorCreator({
|
||||||
memoize: weakMapMemoize,
|
memoize: lruMemoize,
|
||||||
argsMemoize: weakMapMemoize,
|
argsMemoize: lruMemoize,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const createLruDraftSafeSelector = createDraftSafeSelectorCreator({
|
export const createLruDraftSafeSelector = createDraftSafeSelectorCreator({
|
||||||
memoize: weakMapMemoize,
|
memoize: lruMemoize,
|
||||||
argsMemoize: weakMapMemoize,
|
argsMemoize: lruMemoize,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const getSelectorsOptions: GetSelectorsOptions = {
|
export const getSelectorsOptions: GetSelectorsOptions = {
|
||||||
|
Loading…
Reference in New Issue
Block a user