summaryrefslogtreecommitdiff
path: root/src/signal.js
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2014-11-29 22:28:29 +0200
committerAlon Levy <alon@pobox.com>2014-11-29 22:33:44 +0200
commit42eacd877b5564961c2dcc491f5d4b7d62f4e753 (patch)
tree6fce918b89bc0093671db978a26d5821036e1ade /src/signal.js
parent372aac3fafedbd517cf26501ef70015f47feb7f9 (diff)
use Bacon instead of signal
See https://github.com/baconjs/bacon.js Usage right now: we have rz_bus to hold global busses: - names: for autosuggest - ui busses: - ui_key - ui_input The events are objects with {where: from consts, keys/input} (could maybe just use the events and rely on the target element class/id) And graph has it's own bus: graph.diffBus (camelcase probably not the right style - will fix in later commit) To publish to a bus you use push. To insert another stream to a bus you use plug. To listen to a bus you use onValue (you can use subscribe too to get errors and end of stream event, but we don't use that yet). This allows usage of map, filter, flatMap, see github repo for cool examples.
Diffstat (limited to 'src/signal.js')
-rw-r--r--src/signal.js22
1 files changed, 0 insertions, 22 deletions
diff --git a/src/signal.js b/src/signal.js
deleted file mode 100644
index e5888b4c..00000000
--- a/src/signal.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Signal/slot (i.e. blackboard pattern) for rhizi.
- *
- * This is a thin wrapper over jquery right now.
- * But just keeping it here to make any future change of implementation slightly
- * easier.
- */
-
-define(['jquery'], function($) {
- function slot(name, handler) {
- $(window).on(name, function(e, args) {
- handler(args);
- });
- };
- function signal(name, obj) {
- $(window).trigger(name, obj);
- }
- return {
- 'slot': slot,
- 'signal': signal
- };
-})