diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2020-03-15 12:38:00 +0000 |
|---|---|---|
| committer | s-ol <s-ol@users.noreply.github.com> | 2020-03-15 12:38:00 +0000 |
| commit | 23f893a1303b35e11d7103d892c40b7e8d209a06 (patch) | |
| tree | 768db1660b0fe00c711a1b54f0e3297c24732164 /core | |
| parent | docs/guide: runtime description (diff) | |
| download | alive-23f893a1303b35e11d7103d892c40b7e8d209a06.tar.gz alive-23f893a1303b35e11d7103d892c40b7e8d209a06.zip | |
add Input spec
Close #8
Diffstat (limited to 'core')
| -rw-r--r-- | core/base/input.moon | 6 | ||||
| -rw-r--r-- | core/registry.moon | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/core/base/input.moon b/core/base/input.moon index dae5b43..c89337f 100644 --- a/core/base/input.moon +++ b/core/base/input.moon @@ -119,8 +119,10 @@ class ColdInput extends Input class ValueInput extends Input setup: (old) => @dirty_setup = not old or @stream != old.stream - finish_setup: => @dirty_setup = false - dirty: => @dirty_setup or @stream\dirty! + finish_setup: => @dirty_setup = nil + dirty: => + return @dirty_setup if @dirty_setup != nil + @stream\dirty! class EventInput extends Input diff --git a/core/registry.moon b/core/registry.moon index 374337a..9627447 100644 --- a/core/registry.moon +++ b/core/registry.moon @@ -99,8 +99,10 @@ class Registry class SimpleRegistry extends Registry new: => @cnt = 1 + @tick = 0 - tick: 0 + next_tick: => + @tick += 1 init: (tag, expr) => tag\set @cnt |
