From e16efaf6603c4da33b74b499e0e1214c46ddf72d Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Wed, 17 Jul 2019 14:28:46 -0400 Subject: New JavaScript FFI function 'listen' --- lib/js/urweb.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib') diff --git a/lib/js/urweb.js b/lib/js/urweb.js index 66d427c8..332de6dc 100644 --- a/lib/js/urweb.js +++ b/lib/js/urweb.js @@ -2135,6 +2135,16 @@ function active(s) { } } +function listen(s, onchange) { + var x = document.createElement("script"); + x.dead = false; + x.signal = s; + x.sources = null; + x.closures = null; + x.recreate = onchange; + populate(x); +} + function input(x, s, recreate, type, name) { if (name) x.name = name; if (type) x.type = type; -- cgit v1.2.3