[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
+3
View File
@@ -274,6 +274,9 @@ Note that if the selector function returns a primitive type, the result of
is important to define the `onUpdate` option to properly update the value
manually when it changes.
Also, the return value from `useStore` is not supposed to be modified. The store
state should only be updated with actions.
### `useDispatch`
The `useDispatch` hook is useful when a component needs to be able to dispatch