diff options
| author | Jan Tuomi <jan.tuomi@eficode.com> | 2018-03-03 17:44:55 +0200 |
|---|---|---|
| committer | Jan Tuomi <jan.tuomi@eficode.com> | 2018-03-03 17:44:55 +0200 |
| commit | db90ddaec4181c85c40b6897ab87342948f28e8b (patch) | |
| tree | 0325b93606d0639a65a4e8efaf4a3a8b6926d09a /src | |
| parent | 7f3665b501217db16deb62d079cc18506f6ac566 (diff) | |
Start using riot-vigilante
Diffstat (limited to 'src')
| -rw-r--r-- | src/components/counter/counter.tag | 2 | ||||
| -rw-r--r-- | src/components/push-button/push-button.tag | 2 | ||||
| -rw-r--r-- | src/components/site/site.tag | 2 | ||||
| -rw-r--r-- | src/observables/clicker.js | 9 | ||||
| -rw-r--r-- | src/observables/index.js | 3 |
5 files changed, 3 insertions, 15 deletions
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 @@ <script> click() { - clicker.trigger('click'); + observe('clicker').trigger('click'); } </script> </push-button>
\ 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 @@ <script> /* Import everything that you want to have in scope in your tags here */ import riot from 'riot'; - import { clicker } from './observables'; + import { observe } from 'vigilante'; </script> </site>
\ 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 |
