mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[IMP] store: prevent changes to store state in useStore return value
closes #500
This commit is contained in:
+1
-2
@@ -134,8 +134,7 @@ export function useStore(selector, options: SelectorOptions = {}): any {
|
||||
return result[k];
|
||||
},
|
||||
set(target, k, v) {
|
||||
result[k] = v;
|
||||
return true;
|
||||
throw new Error("Store state should only be modified through actions");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user