From db90ddaec4181c85c40b6897ab87342948f28e8b Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Sat, 3 Mar 2018 17:44:55 +0200 Subject: Start using riot-vigilante --- package.json | 3 ++- src/components/counter/counter.tag | 2 +- src/components/push-button/push-button.tag | 2 +- src/components/site/site.tag | 2 +- src/observables/clicker.js | 9 --------- src/observables/index.js | 3 --- yarn.lock | 8 +++++++- 7 files changed, 12 insertions(+), 17 deletions(-) delete mode 100644 src/observables/clicker.js delete mode 100644 src/observables/index.js diff --git a/package.json b/package.json index 5ee0a57..5476eca 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,8 @@ }, "dependencies": { "less": "^3.0.1", - "riot": "^3.7.4" + "riot": "^3.7.4", + "riot-vigilante": "^1.0.1" }, "devDependencies": { "babel-core": "^6.26.0", diff --git a/src/components/counter/counter.tag b/src/components/counter/counter.tag index d558e8e..a319436 100644 --- a/src/components/counter/counter.tag +++ b/src/components/counter/counter.tag @@ -5,7 +5,7 @@ this.count = 0; const counter = this; - clicker.on('click', () => { + observe('clicker').on('click', () => { counter.count += 1; counter.update(); }); diff --git a/src/components/push-button/push-button.tag b/src/components/push-button/push-button.tag index 2d24c88..6517591 100644 --- a/src/components/push-button/push-button.tag +++ b/src/components/push-button/push-button.tag @@ -7,7 +7,7 @@ \ No newline at end of file diff --git a/src/components/site/site.tag b/src/components/site/site.tag index c5e8706..a0dc173 100644 --- a/src/components/site/site.tag +++ b/src/components/site/site.tag @@ -5,6 +5,6 @@ \ No newline at end of file diff --git a/src/observables/clicker.js b/src/observables/clicker.js deleted file mode 100644 index ae3d3b1..0000000 --- a/src/observables/clicker.js +++ /dev/null @@ -1,9 +0,0 @@ -import riot from 'riot'; - -function Clicker() { - riot.observable(this); -} - -const clicker = new Clicker(); - -export default clicker; \ No newline at end of file diff --git a/src/observables/index.js b/src/observables/index.js deleted file mode 100644 index d26b412..0000000 --- a/src/observables/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import clicker from './clicker'; - -export { clicker }; \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 5c91c76..86eef88 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3366,7 +3366,13 @@ riot-tmpl@^3.0.8: dependencies: eslint-config-riot "^1.0.0" -riot@^3.7.4: +riot-vigilante@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/riot-vigilante/-/riot-vigilante-1.0.1.tgz#3d5c05f940682abc0bf5b3233455a3289547a9e6" + dependencies: + riot "^3.9.0" + +riot@^3.7.4, riot@^3.9.0: version "3.9.0" resolved "https://registry.yarnpkg.com/riot/-/riot-3.9.0.tgz#a7a87b82ff8240d99ab0112f6033b532a6d41abd" dependencies: -- cgit v1.3