From 6ff4dd74bfc7e8040484333cbde3beef0d1a2ca9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Wed, 28 Aug 2019 12:10:46 +0200 Subject: [PATCH] [DOC] readme: improve main example --- README.md | 14 +++++++++++--- doc/store.md | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 87f509bb..c1ad94f1 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,10 @@ Here is a short example to illustrate interactive components: +
+ Hello Owl + +
``` @@ -35,9 +39,13 @@ class Counter extends owl.Component { } } +class App extends owl.Component { + components = { Counter }; +} + const qweb = new owl.QWeb(TEMPLATES); -const counter = new Counter({ qweb }); -counter.mount(document.body); +const app = new App({ qweb }); +app.mount(document.body); ``` Note that we assume here that the xml templates are available in the `TEMPLATES` @@ -99,4 +107,4 @@ Some npm scripts are available: ## License -OWL is [GPL licensed](./LICENSE). +OWL is [LGPL licensed](./LICENSE). diff --git a/doc/store.md b/doc/store.md index e27f4d32..67b08bab 100644 --- a/doc/store.md +++ b/doc/store.md @@ -103,7 +103,7 @@ const actions = { try { const loginInfo = await doSomeRPC("/login/", info); state.loginState = loginInfo; - } catch { + } catch (e) { state.loginState = "error"; } }