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