[IMP] store: prevent changes to store state in useStore return value

closes #500
This commit is contained in:
Géry Debongnie
2019-11-26 22:51:35 +01:00
committed by aab-odoo
parent 8fb35ed969
commit 1f079b883e
3 changed files with 22 additions and 2 deletions
+1 -2
View File
@@ -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");
}
});
}