mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] reactivity: work even if no callback is given
This commit is contained in:
committed by
Aaron Bohy
parent
92cc4375f8
commit
06fc3a2c77
+1
-1
@@ -130,7 +130,7 @@ const reactiveCache = new WeakMap<Target, WeakMap<Callback, Reactive>>();
|
||||
* reactive has changed
|
||||
* @returns a proxy that tracks changes to it
|
||||
*/
|
||||
export function reactive<T extends Target>(target: T, callback: Callback): Reactive<T> {
|
||||
export function reactive<T extends Target>(target: T, callback: Callback = () => {}): Reactive<T> {
|
||||
if (!canBeMadeReactive(target)) {
|
||||
throw new Error(`Cannot make the given value reactive`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user