mirror of
https://github.com/swc-project/swc.git
synced 2024-12-20 20:22:26 +03:00
e4e4d6cf6b
**Related issue:** - Closes https://github.com/swc-project/swc/issues/6636.
8 lines
148 B
JavaScript
8 lines
148 B
JavaScript
export function memo(fn, opts) {
|
|
let result;
|
|
return () => {
|
|
result = fn(...newDeps);
|
|
opts?.onChange?.(result);
|
|
return result;
|
|
};
|
|
} |