[REF] store: simplify connect API

Closes #158
This commit is contained in:
Aaron Bohy
2019-06-11 09:32:28 +02:00
committed by Géry Debongnie
parent 1ff3c32fe4
commit 22e48e3be0
4 changed files with 199 additions and 155 deletions
+3 -3
View File
@@ -176,7 +176,7 @@ function mapStoreToProps(state) {
value: state.counter
};
}
const ConnectedCounter = owl.connect(mapStoreToProps)(Counter);
const ConnectedCounter = owl.connect(Counter, mapStoreToProps);
const counter = new ConnectedCounter({ store, qweb });
```
@@ -199,5 +199,5 @@ The arguments of `connect` are:
- `deep`: [only useful if no hashFunction is given] if false, only watch
for top level state changes (true by default)
The `connect` function returns a function that takes a `Component` as argument
and returns a sub Class of this `Component` that is connected to the `store`
The `connect` function returns a sub class of the given `Component` which is
connected to the `store`.