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>
32 lines
1.2 KiB
TypeScript
32 lines
1.2 KiB
TypeScript
declare type Cleanup = () => void;
|
|
declare type WatchGet = <T extends object>(proxyObject: T) => T;
|
|
declare type WatchCallback = (get: WatchGet) => Cleanup | void | undefined;
|
|
declare type WatchOptions = {
|
|
sync?: boolean;
|
|
};
|
|
/**
|
|
* watch
|
|
*
|
|
* Creates a reactive effect that automatically tracks proxy objects and
|
|
* reevaluates everytime one of the tracked proxy objects updates. It returns
|
|
* a cleanup function to stop the reactive effect from reevaluating.
|
|
*
|
|
* Callback is invoked immediately to detect the tracked objects.
|
|
*
|
|
* Callback passed to `watch` receives a `get` function that "tracks" the
|
|
* passed proxy object.
|
|
*
|
|
* Watch callbacks may return an optional cleanup function, which is evaluated
|
|
* whenever the callback reevaluates or when the cleanup function returned by
|
|
* `watch` is evaluated.
|
|
*
|
|
* `watch` calls inside `watch` are also automatically tracked and cleaned up
|
|
* whenever the parent `watch` reevaluates.
|
|
*
|
|
* @param callback
|
|
* @returns A cleanup function that stops the callback from reevaluating and
|
|
* also performs cleanups registered into `watch`.
|
|
*/
|
|
export declare function watch(callback: WatchCallback, options?: WatchOptions): Cleanup;
|
|
export {};
|