Add coexistence checks to all enqueue methods to prevent loading both React and Grid.js assets simultaneously. Changes: - ReactAdmin.php: Only enqueue React assets when ?react=1 - Init.php: Skip Grid.js when React active on admin pages - Form.php, Coupon.php, Access.php: Restore classic assets when ?react=0 - Customer.php, Product.php, License.php: Add coexistence checks Now the toggle between Classic and React versions works correctly. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
65 lines
2.1 KiB
TypeScript
65 lines
2.1 KiB
TypeScript
declare module "rememo" {
|
|
/**
|
|
* Returns a memoized selector function. The getDependants function argument is
|
|
* called before the memoized selector and is expected to return an immutable
|
|
* reference or array of references on which the selector depends for computing
|
|
* its own return value. The memoize cache is preserved only as long as those
|
|
* dependant references remain the same. If getDependants returns a different
|
|
* reference(s), the cache is cleared and the selector value regenerated.
|
|
*
|
|
* @template {(...args: *[]) => *} S
|
|
*
|
|
* @param {S} selector Selector function.
|
|
* @param {GetDependants=} getDependants Dependant getter returning an array of
|
|
* references used in cache bust consideration.
|
|
*/
|
|
export default function _default<S extends (...args: any[]) => any>(selector: S, getDependants?: GetDependants | undefined): S & EnhancedSelector;
|
|
export type GetDependants = (...args: any[]) => any[];
|
|
export type Clear = () => void;
|
|
export type EnhancedSelector = {
|
|
getDependants: GetDependants;
|
|
clear: Clear;
|
|
};
|
|
/**
|
|
* Internal cache entry.
|
|
*/
|
|
export type CacheNode = {
|
|
/**
|
|
* Previous node.
|
|
*/
|
|
prev?: (CacheNode | undefined) | null;
|
|
/**
|
|
* Next node.
|
|
*/
|
|
next?: (CacheNode | undefined) | null;
|
|
/**
|
|
* Function arguments for cache entry.
|
|
*/
|
|
args: any[];
|
|
/**
|
|
* Function result.
|
|
*/
|
|
val: any;
|
|
};
|
|
export type Cache = {
|
|
/**
|
|
* Function to clear cache.
|
|
*/
|
|
clear: Clear;
|
|
/**
|
|
* Whether dependants are valid in
|
|
* considering cache uniqueness. A cache is unique if dependents are all arrays
|
|
* or objects.
|
|
*/
|
|
isUniqueByDependants?: boolean | undefined;
|
|
/**
|
|
* Cache head.
|
|
*/
|
|
head?: CacheNode | null | undefined;
|
|
/**
|
|
* Dependants from previous invocation.
|
|
*/
|
|
lastDependants?: any[] | undefined;
|
|
};
|
|
}
|