[REF] component: small improvement

and run prettier
This commit is contained in:
Géry Debongnie
2019-10-31 21:28:35 +01:00
parent 05a678c039
commit 534152eff7
7 changed files with 53 additions and 58 deletions
+18 -19
View File
@@ -20,29 +20,28 @@ create a test environment with mock services.
For example:
```js
async function myEnv() {
const templates = await loadTemplates();
const qweb = new QWeb({templates});
const session = getSession();
const templates = await loadTemplates();
const qweb = new QWeb({ templates });
const session = getSession();
return {
_t: myTranslateFunction,
session: session,
qweb: qweb,
services: {
localStorage: localStorage,
rpc: rpc,
},
debug: false,
inMobileMode: true,
};
return {
_t: myTranslateFunction,
session: session,
qweb: qweb,
services: {
localStorage: localStorage,
rpc: rpc
},
debug: false,
inMobileMode: true
};
}
async function start() {
owl.config.env = await myEnv();
const app = new App();
await app.mount(document.body);
owl.config.env = await myEnv();
const app = new App();
await app.mount(document.body);
}
```
```
+2 -2
View File
@@ -1,6 +1,7 @@
# 🦉 OWL Documentation 🦉
## Reference
- [Animations](reference/animations.md)
- [Component](reference/component.md)
- [Configuration](reference/config.md)
@@ -43,7 +44,7 @@ and `EventBus` is exported as `owl.core.EventBus`):
```
Component misc
Context AsyncRoot
Context AsyncRoot
QWeb router
Store Link
useState RouteComponent
@@ -70,4 +71,3 @@ hooks loadJS
```
Note that for convenience, the `useState` hook is also exported at the root of the `owl` object.
+2 -2
View File
@@ -1,7 +1,7 @@
# 🦉 Config 🦉
The Owl framework is designed to work in many situations. However, it is
sometimes necessary to customize some behaviour. This is done by using the
The Owl framework is designed to work in many situations. However, it is
sometimes necessary to customize some behaviour. This is done by using the
global `config` object. It currently has two keys:
- [`mode`](#mode),
-1
View File
@@ -15,4 +15,3 @@ Note: some additional information can be found here:
- [What should go into an environment?](../learning/environment.md)
- [Customizing an environment](config.md#env)