@p4ulcristian/iris-layout 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cljs-runtime/cljs.core.js +38746 -0
- package/dist/cljs-runtime/cljs.core.js.map +1 -0
- package/dist/cljs-runtime/cljs.pprint.js +8400 -0
- package/dist/cljs-runtime/cljs.pprint.js.map +1 -0
- package/dist/cljs-runtime/cljs.stacktrace.js +561 -0
- package/dist/cljs-runtime/cljs.stacktrace.js.map +1 -0
- package/dist/cljs-runtime/cljs_env.js +1286 -0
- package/dist/cljs-runtime/clojure.data.js +295 -0
- package/dist/cljs-runtime/clojure.data.js.map +1 -0
- package/dist/cljs-runtime/clojure.set.js +382 -0
- package/dist/cljs-runtime/clojure.set.js.map +1 -0
- package/dist/cljs-runtime/clojure.string.js +480 -0
- package/dist/cljs-runtime/clojure.string.js.map +1 -0
- package/dist/cljs-runtime/clojure.walk.js +132 -0
- package/dist/cljs-runtime/clojure.walk.js.map +1 -0
- package/dist/cljs-runtime/devtools.async.js +90 -0
- package/dist/cljs-runtime/devtools.async.js.map +1 -0
- package/dist/cljs-runtime/devtools.context.js +11 -0
- package/dist/cljs-runtime/devtools.context.js.map +1 -0
- package/dist/cljs-runtime/devtools.core.js +175 -0
- package/dist/cljs-runtime/devtools.core.js.map +1 -0
- package/dist/cljs-runtime/devtools.defaults.js +20 -0
- package/dist/cljs-runtime/devtools.defaults.js.map +1 -0
- package/dist/cljs-runtime/devtools.format.js +631 -0
- package/dist/cljs-runtime/devtools.format.js.map +1 -0
- package/dist/cljs-runtime/devtools.formatters.budgeting.js +182 -0
- package/dist/cljs-runtime/devtools.formatters.budgeting.js.map +1 -0
- package/dist/cljs-runtime/devtools.formatters.core.js +220 -0
- package/dist/cljs-runtime/devtools.formatters.core.js.map +1 -0
- package/dist/cljs-runtime/devtools.formatters.helpers.js +228 -0
- package/dist/cljs-runtime/devtools.formatters.helpers.js.map +1 -0
- package/dist/cljs-runtime/devtools.formatters.js +261 -0
- package/dist/cljs-runtime/devtools.formatters.js.map +1 -0
- package/dist/cljs-runtime/devtools.formatters.markup.js +1174 -0
- package/dist/cljs-runtime/devtools.formatters.markup.js.map +1 -0
- package/dist/cljs-runtime/devtools.formatters.printing.js +313 -0
- package/dist/cljs-runtime/devtools.formatters.printing.js.map +1 -0
- package/dist/cljs-runtime/devtools.formatters.state.js +325 -0
- package/dist/cljs-runtime/devtools.formatters.state.js.map +1 -0
- package/dist/cljs-runtime/devtools.formatters.templating.js +666 -0
- package/dist/cljs-runtime/devtools.formatters.templating.js.map +1 -0
- package/dist/cljs-runtime/devtools.hints.js +193 -0
- package/dist/cljs-runtime/devtools.hints.js.map +1 -0
- package/dist/cljs-runtime/devtools.munging.js +1058 -0
- package/dist/cljs-runtime/devtools.munging.js.map +1 -0
- package/dist/cljs-runtime/devtools.prefs.js +87 -0
- package/dist/cljs-runtime/devtools.prefs.js.map +1 -0
- package/dist/cljs-runtime/devtools.preload.js +11 -0
- package/dist/cljs-runtime/devtools.preload.js.map +1 -0
- package/dist/cljs-runtime/devtools.protocols.js +98 -0
- package/dist/cljs-runtime/devtools.protocols.js.map +1 -0
- package/dist/cljs-runtime/devtools.reporter.js +81 -0
- package/dist/cljs-runtime/devtools.reporter.js.map +1 -0
- package/dist/cljs-runtime/devtools.toolbox.js +141 -0
- package/dist/cljs-runtime/devtools.toolbox.js.map +1 -0
- package/dist/cljs-runtime/devtools.util.js +517 -0
- package/dist/cljs-runtime/devtools.util.js.map +1 -0
- package/dist/cljs-runtime/devtools.version.js +9 -0
- package/dist/cljs-runtime/devtools.version.js.map +1 -0
- package/dist/cljs-runtime/goog.array.array.js +659 -0
- package/dist/cljs-runtime/goog.array.array.js.map +9 -0
- package/dist/cljs-runtime/goog.asserts.asserts.js +133 -0
- package/dist/cljs-runtime/goog.asserts.asserts.js.map +9 -0
- package/dist/cljs-runtime/goog.asserts.dom.js +90 -0
- package/dist/cljs-runtime/goog.asserts.dom.js.map +9 -0
- package/dist/cljs-runtime/goog.async.nexttick.js +93 -0
- package/dist/cljs-runtime/goog.async.nexttick.js.map +9 -0
- package/dist/cljs-runtime/goog.base.js +1261 -0
- package/dist/cljs-runtime/goog.base.js.map +9 -0
- package/dist/cljs-runtime/goog.collections.maps.js +82 -0
- package/dist/cljs-runtime/goog.collections.maps.js.map +9 -0
- package/dist/cljs-runtime/goog.debug.entrypointregistry.js +44 -0
- package/dist/cljs-runtime/goog.debug.entrypointregistry.js.map +9 -0
- package/dist/cljs-runtime/goog.debug.error.js +30 -0
- package/dist/cljs-runtime/goog.debug.error.js.map +9 -0
- package/dist/cljs-runtime/goog.dom.asserts.js +40 -0
- package/dist/cljs-runtime/goog.dom.asserts.js.map +9 -0
- package/dist/cljs-runtime/goog.dom.browserfeature.js +21 -0
- package/dist/cljs-runtime/goog.dom.browserfeature.js.map +9 -0
- package/dist/cljs-runtime/goog.dom.dom.js +1087 -0
- package/dist/cljs-runtime/goog.dom.dom.js.map +9 -0
- package/dist/cljs-runtime/goog.dom.element.js +69 -0
- package/dist/cljs-runtime/goog.dom.element.js.map +9 -0
- package/dist/cljs-runtime/goog.dom.htmlelement.js +7 -0
- package/dist/cljs-runtime/goog.dom.htmlelement.js.map +9 -0
- package/dist/cljs-runtime/goog.dom.nodetype.js +6 -0
- package/dist/cljs-runtime/goog.dom.nodetype.js.map +9 -0
- package/dist/cljs-runtime/goog.dom.safe.js +277 -0
- package/dist/cljs-runtime/goog.dom.safe.js.map +9 -0
- package/dist/cljs-runtime/goog.dom.tagname.js +147 -0
- package/dist/cljs-runtime/goog.dom.tagname.js.map +9 -0
- package/dist/cljs-runtime/goog.dom.tags.js +10 -0
- package/dist/cljs-runtime/goog.dom.tags.js.map +9 -0
- package/dist/cljs-runtime/goog.flags.flags.js +12 -0
- package/dist/cljs-runtime/goog.flags.flags.js.map +9 -0
- package/dist/cljs-runtime/goog.fs.blob.js +38 -0
- package/dist/cljs-runtime/goog.fs.blob.js.map +9 -0
- package/dist/cljs-runtime/goog.fs.url.js +37 -0
- package/dist/cljs-runtime/goog.fs.url.js.map +9 -0
- package/dist/cljs-runtime/goog.functions.functions.js +211 -0
- package/dist/cljs-runtime/goog.functions.functions.js.map +9 -0
- package/dist/cljs-runtime/goog.html.safehtml.js +321 -0
- package/dist/cljs-runtime/goog.html.safehtml.js.map +9 -0
- package/dist/cljs-runtime/goog.html.safescript.js +65 -0
- package/dist/cljs-runtime/goog.html.safescript.js.map +9 -0
- package/dist/cljs-runtime/goog.html.safestyle.js +175 -0
- package/dist/cljs-runtime/goog.html.safestyle.js.map +9 -0
- package/dist/cljs-runtime/goog.html.safestylesheet.js +99 -0
- package/dist/cljs-runtime/goog.html.safestylesheet.js.map +9 -0
- package/dist/cljs-runtime/goog.html.safeurl.js +231 -0
- package/dist/cljs-runtime/goog.html.safeurl.js.map +9 -0
- package/dist/cljs-runtime/goog.html.trustedresourceurl.js +123 -0
- package/dist/cljs-runtime/goog.html.trustedresourceurl.js.map +9 -0
- package/dist/cljs-runtime/goog.html.trustedtypes.js +16 -0
- package/dist/cljs-runtime/goog.html.trustedtypes.js.map +9 -0
- package/dist/cljs-runtime/goog.html.uncheckedconversions.js +52 -0
- package/dist/cljs-runtime/goog.html.uncheckedconversions.js.map +9 -0
- package/dist/cljs-runtime/goog.labs.useragent.browser.js +352 -0
- package/dist/cljs-runtime/goog.labs.useragent.browser.js.map +9 -0
- package/dist/cljs-runtime/goog.labs.useragent.engine.js +73 -0
- package/dist/cljs-runtime/goog.labs.useragent.engine.js.map +9 -0
- package/dist/cljs-runtime/goog.labs.useragent.highentropy.highentropydata.js +14 -0
- package/dist/cljs-runtime/goog.labs.useragent.highentropy.highentropydata.js.map +9 -0
- package/dist/cljs-runtime/goog.labs.useragent.highentropy.highentropyvalue.js +74 -0
- package/dist/cljs-runtime/goog.labs.useragent.highentropy.highentropyvalue.js.map +9 -0
- package/dist/cljs-runtime/goog.labs.useragent.platform.js +147 -0
- package/dist/cljs-runtime/goog.labs.useragent.platform.js.map +9 -0
- package/dist/cljs-runtime/goog.labs.useragent.useragent.js +21 -0
- package/dist/cljs-runtime/goog.labs.useragent.useragent.js.map +9 -0
- package/dist/cljs-runtime/goog.labs.useragent.util.js +81 -0
- package/dist/cljs-runtime/goog.labs.useragent.util.js.map +9 -0
- package/dist/cljs-runtime/goog.math.coordinate.js +97 -0
- package/dist/cljs-runtime/goog.math.coordinate.js.map +9 -0
- package/dist/cljs-runtime/goog.math.integer.js +445 -0
- package/dist/cljs-runtime/goog.math.integer.js.map +9 -0
- package/dist/cljs-runtime/goog.math.long.js +437 -0
- package/dist/cljs-runtime/goog.math.long.js.map +9 -0
- package/dist/cljs-runtime/goog.math.math.js +158 -0
- package/dist/cljs-runtime/goog.math.math.js.map +9 -0
- package/dist/cljs-runtime/goog.math.size.js +76 -0
- package/dist/cljs-runtime/goog.math.size.js.map +9 -0
- package/dist/cljs-runtime/goog.object.object.js +284 -0
- package/dist/cljs-runtime/goog.object.object.js.map +9 -0
- package/dist/cljs-runtime/goog.reflect.reflect.js +32 -0
- package/dist/cljs-runtime/goog.reflect.reflect.js.map +9 -0
- package/dist/cljs-runtime/goog.string.const.js +35 -0
- package/dist/cljs-runtime/goog.string.const.js.map +9 -0
- package/dist/cljs-runtime/goog.string.internal.js +119 -0
- package/dist/cljs-runtime/goog.string.internal.js.map +9 -0
- package/dist/cljs-runtime/goog.string.string.js +462 -0
- package/dist/cljs-runtime/goog.string.string.js.map +9 -0
- package/dist/cljs-runtime/goog.string.stringbuffer.js +32 -0
- package/dist/cljs-runtime/goog.string.stringbuffer.js.map +9 -0
- package/dist/cljs-runtime/goog.string.typedstring.js +9 -0
- package/dist/cljs-runtime/goog.string.typedstring.js.map +9 -0
- package/dist/cljs-runtime/goog.structs.structs.js +199 -0
- package/dist/cljs-runtime/goog.structs.structs.js.map +9 -0
- package/dist/cljs-runtime/goog.uri.uri.js +628 -0
- package/dist/cljs-runtime/goog.uri.uri.js.map +9 -0
- package/dist/cljs-runtime/goog.uri.utils.js +326 -0
- package/dist/cljs-runtime/goog.uri.utils.js.map +9 -0
- package/dist/cljs-runtime/goog.useragent.useragent.js +139 -0
- package/dist/cljs-runtime/goog.useragent.useragent.js.map +9 -0
- package/dist/cljs-runtime/iris_layout.components.entity_card_group.js +202 -0
- package/dist/cljs-runtime/iris_layout.components.entity_card_group.js.map +1 -0
- package/dist/cljs-runtime/iris_layout.components.entity_tile.js +295 -0
- package/dist/cljs-runtime/iris_layout.components.entity_tile.js.map +1 -0
- package/dist/cljs-runtime/iris_layout.components.entity_tile_group.js +33 -0
- package/dist/cljs-runtime/iris_layout.components.entity_tile_group.js.map +1 -0
- package/dist/cljs-runtime/iris_layout.components.resizer.js +91 -0
- package/dist/cljs-runtime/iris_layout.components.resizer.js.map +1 -0
- package/dist/cljs-runtime/iris_layout.components.touch_drag.js +399 -0
- package/dist/cljs-runtime/iris_layout.components.touch_drag.js.map +1 -0
- package/dist/cljs-runtime/iris_layout.core.js +1372 -0
- package/dist/cljs-runtime/iris_layout.core.js.map +1 -0
- package/dist/cljs-runtime/iris_layout.layout.js +328 -0
- package/dist/cljs-runtime/iris_layout.layout.js.map +1 -0
- package/dist/cljs-runtime/reagent.core.js +993 -0
- package/dist/cljs-runtime/reagent.core.js.map +1 -0
- package/dist/cljs-runtime/reagent.debug.js +75 -0
- package/dist/cljs-runtime/reagent.debug.js.map +1 -0
- package/dist/cljs-runtime/reagent.impl.batching.js +270 -0
- package/dist/cljs-runtime/reagent.impl.batching.js.map +1 -0
- package/dist/cljs-runtime/reagent.impl.component.js +758 -0
- package/dist/cljs-runtime/reagent.impl.component.js.map +1 -0
- package/dist/cljs-runtime/reagent.impl.input.js +175 -0
- package/dist/cljs-runtime/reagent.impl.input.js.map +1 -0
- package/dist/cljs-runtime/reagent.impl.protocols.js +99 -0
- package/dist/cljs-runtime/reagent.impl.protocols.js.map +1 -0
- package/dist/cljs-runtime/reagent.impl.template.js +660 -0
- package/dist/cljs-runtime/reagent.impl.template.js.map +1 -0
- package/dist/cljs-runtime/reagent.impl.util.js +748 -0
- package/dist/cljs-runtime/reagent.impl.util.js.map +1 -0
- package/dist/cljs-runtime/reagent.ratom.js +1668 -0
- package/dist/cljs-runtime/reagent.ratom.js.map +1 -0
- package/dist/cljs-runtime/shadow.esm.esm_import$react.js +5 -0
- package/dist/cljs-runtime/shadow.module.iris-layout.append.js +2 -0
- package/dist/cljs-runtime/shadow.module.iris-layout.prepend.js +2 -0
- package/dist/iris-layout.js +375 -355
- package/dist/styles.css +287 -9
- package/package.json +1 -1
|
@@ -0,0 +1,1668 @@
|
|
|
1
|
+
import "./cljs_env.js";
|
|
2
|
+
import "./cljs.core.js";
|
|
3
|
+
import "./reagent.impl.util.js";
|
|
4
|
+
import "./reagent.debug.js";
|
|
5
|
+
import "./reagent.impl.batching.js";
|
|
6
|
+
import "./clojure.set.js";
|
|
7
|
+
import "./goog.object.object.js";
|
|
8
|
+
goog.provide('reagent.ratom');
|
|
9
|
+
goog.scope(function(){
|
|
10
|
+
reagent.ratom.goog$module$goog$object = goog.module.get('goog.object');
|
|
11
|
+
});
|
|
12
|
+
if((typeof reagent !== 'undefined') && (typeof reagent.ratom !== 'undefined') && (typeof reagent.ratom.debug !== 'undefined')){
|
|
13
|
+
} else {
|
|
14
|
+
reagent.ratom.debug = false;
|
|
15
|
+
}
|
|
16
|
+
if((typeof reagent !== 'undefined') && (typeof reagent.ratom !== 'undefined') && (typeof reagent.ratom.generation !== 'undefined')){
|
|
17
|
+
} else {
|
|
18
|
+
reagent.ratom.generation = (0);
|
|
19
|
+
}
|
|
20
|
+
if((typeof reagent !== 'undefined') && (typeof reagent.ratom !== 'undefined') && (typeof reagent.ratom._running !== 'undefined')){
|
|
21
|
+
} else {
|
|
22
|
+
reagent.ratom._running = cljs.core.atom.cljs$core$IFn$_invoke$arity$1((0));
|
|
23
|
+
}
|
|
24
|
+
reagent.ratom.reactive_QMARK_ = (function reagent$ratom$reactive_QMARK_(){
|
|
25
|
+
return (!((reagent.ratom._STAR_ratom_context_STAR_ == null)));
|
|
26
|
+
});
|
|
27
|
+
reagent.ratom.running = (function reagent$ratom$running(){
|
|
28
|
+
return (cljs.core.deref(reagent.ratom._running));
|
|
29
|
+
});
|
|
30
|
+
reagent.ratom.arr_len = (function reagent$ratom$arr_len(x){
|
|
31
|
+
if((x == null)){
|
|
32
|
+
return (0);
|
|
33
|
+
} else {
|
|
34
|
+
return x.length;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
reagent.ratom.arr_eq = (function reagent$ratom$arr_eq(x,y){
|
|
38
|
+
var len = reagent.ratom.arr_len(x);
|
|
39
|
+
var and__5000__auto__ = (len === reagent.ratom.arr_len(y));
|
|
40
|
+
if(and__5000__auto__){
|
|
41
|
+
var i = (0);
|
|
42
|
+
while(true){
|
|
43
|
+
var or__5002__auto__ = (i === len);
|
|
44
|
+
if(or__5002__auto__){
|
|
45
|
+
return or__5002__auto__;
|
|
46
|
+
} else {
|
|
47
|
+
if(((x[i]) === (y[i]))){
|
|
48
|
+
var G__12332 = (i + (1));
|
|
49
|
+
i = G__12332;
|
|
50
|
+
continue;
|
|
51
|
+
} else {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
} else {
|
|
58
|
+
return and__5000__auto__;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
/**
|
|
62
|
+
* When f is executed, if (f) derefs any ratoms, they are then added to 'obj.captured'(*ratom-context*).
|
|
63
|
+
*
|
|
64
|
+
* See function notify-deref-watcher! to know how *ratom-context* is updated
|
|
65
|
+
*/
|
|
66
|
+
reagent.ratom.in_context = (function reagent$ratom$in_context(obj,f){
|
|
67
|
+
var _STAR_ratom_context_STAR__orig_val__11752 = reagent.ratom._STAR_ratom_context_STAR_;
|
|
68
|
+
var _STAR_ratom_context_STAR__temp_val__11753 = obj;
|
|
69
|
+
(reagent.ratom._STAR_ratom_context_STAR_ = _STAR_ratom_context_STAR__temp_val__11753);
|
|
70
|
+
|
|
71
|
+
try{return (f.cljs$core$IFn$_invoke$arity$0 ? f.cljs$core$IFn$_invoke$arity$0() : f.call(null));
|
|
72
|
+
}finally {(reagent.ratom._STAR_ratom_context_STAR_ = _STAR_ratom_context_STAR__orig_val__11752);
|
|
73
|
+
}});
|
|
74
|
+
/**
|
|
75
|
+
* Returns `(in-context r f)`. Calls `_update-watching` on r with any
|
|
76
|
+
* `deref`ed atoms captured during `in-context`, if any differ from the
|
|
77
|
+
* `watching` field of r. Clears the `dirty?` flag on r.
|
|
78
|
+
*
|
|
79
|
+
* Inside '_update-watching' along with adding the ratoms in 'r.watching' of reaction,
|
|
80
|
+
* the reaction is also added to the list of watches on each ratoms f derefs.
|
|
81
|
+
*/
|
|
82
|
+
reagent.ratom.deref_capture = (function reagent$ratom$deref_capture(f,r){
|
|
83
|
+
(r.captured = null);
|
|
84
|
+
|
|
85
|
+
(r.ratomGeneration = (reagent.ratom.generation = (reagent.ratom.generation + (1))));
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
var res = reagent.ratom.in_context(r,f);
|
|
89
|
+
var c = r.captured;
|
|
90
|
+
(r.dirty_QMARK_ = false);
|
|
91
|
+
|
|
92
|
+
if(reagent.ratom.arr_eq(c,r.watching)){
|
|
93
|
+
} else {
|
|
94
|
+
r._update_watching(c);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return res;
|
|
98
|
+
});
|
|
99
|
+
/**
|
|
100
|
+
* Add `derefed` to the `captured` field of `*ratom-context*`.
|
|
101
|
+
*
|
|
102
|
+
* See also `in-context`
|
|
103
|
+
*/
|
|
104
|
+
reagent.ratom.notify_deref_watcher_BANG_ = (function reagent$ratom$notify_deref_watcher_BANG_(derefed){
|
|
105
|
+
var temp__5808__auto__ = reagent.ratom._STAR_ratom_context_STAR_;
|
|
106
|
+
if((temp__5808__auto__ == null)){
|
|
107
|
+
return null;
|
|
108
|
+
} else {
|
|
109
|
+
var r = temp__5808__auto__;
|
|
110
|
+
var c = r.captured;
|
|
111
|
+
if((c == null)){
|
|
112
|
+
return (r.captured = [derefed]);
|
|
113
|
+
} else {
|
|
114
|
+
return c.push(derefed);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
reagent.ratom.check_watches = (function reagent$ratom$check_watches(old,new$){
|
|
119
|
+
if(reagent.ratom.debug){
|
|
120
|
+
cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$3(reagent.ratom._running,cljs.core._PLUS_,(cljs.core.count(new$) - cljs.core.count(old)));
|
|
121
|
+
} else {
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return new$;
|
|
125
|
+
});
|
|
126
|
+
reagent.ratom.add_w = (function reagent$ratom$add_w(this$,key,f){
|
|
127
|
+
var w = this$.watches;
|
|
128
|
+
(this$.watches = reagent.ratom.check_watches(w,cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(w,key,f)));
|
|
129
|
+
|
|
130
|
+
return (this$.watchesArr = null);
|
|
131
|
+
});
|
|
132
|
+
reagent.ratom.remove_w = (function reagent$ratom$remove_w(this$,key){
|
|
133
|
+
var w = this$.watches;
|
|
134
|
+
(this$.watches = reagent.ratom.check_watches(w,cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(w,key)));
|
|
135
|
+
|
|
136
|
+
return (this$.watchesArr = null);
|
|
137
|
+
});
|
|
138
|
+
reagent.ratom.notify_w = (function reagent$ratom$notify_w(this$,old,new$){
|
|
139
|
+
var w = this$.watchesArr;
|
|
140
|
+
var a = (((w == null))?(this$.watchesArr = cljs.core.reduce_kv((function (p1__11796_SHARP_,p2__11797_SHARP_,p3__11798_SHARP_){
|
|
141
|
+
var G__11827 = p1__11796_SHARP_;
|
|
142
|
+
G__11827.push(p2__11797_SHARP_);
|
|
143
|
+
|
|
144
|
+
G__11827.push(p3__11798_SHARP_);
|
|
145
|
+
|
|
146
|
+
return G__11827;
|
|
147
|
+
}),[],this$.watches)):w);
|
|
148
|
+
var len = a.length;
|
|
149
|
+
var i = (0);
|
|
150
|
+
while(true){
|
|
151
|
+
if((i < len)){
|
|
152
|
+
var k_12333 = (a[i]);
|
|
153
|
+
var f_12334 = (a[(i + (1))]);
|
|
154
|
+
(f_12334.cljs$core$IFn$_invoke$arity$4 ? f_12334.cljs$core$IFn$_invoke$arity$4(k_12333,this$,old,new$) : f_12334.call(null,k_12333,this$,old,new$));
|
|
155
|
+
|
|
156
|
+
var G__12335 = ((2) + i);
|
|
157
|
+
i = G__12335;
|
|
158
|
+
continue;
|
|
159
|
+
} else {
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
reagent.ratom.pr_atom = (function reagent$ratom$pr_atom(a,writer,opts,s,v){
|
|
166
|
+
cljs.core._write(writer,["#object[reagent.ratom.",cljs.core.str.cljs$core$IFn$_invoke$arity$1(s)," "].join(''));
|
|
167
|
+
|
|
168
|
+
cljs.core.pr_writer((function (){var _STAR_ratom_context_STAR__orig_val__11842 = reagent.ratom._STAR_ratom_context_STAR_;
|
|
169
|
+
var _STAR_ratom_context_STAR__temp_val__11843 = null;
|
|
170
|
+
(reagent.ratom._STAR_ratom_context_STAR_ = _STAR_ratom_context_STAR__temp_val__11843);
|
|
171
|
+
|
|
172
|
+
try{return v;
|
|
173
|
+
}finally {(reagent.ratom._STAR_ratom_context_STAR_ = _STAR_ratom_context_STAR__orig_val__11842);
|
|
174
|
+
}})(),writer,opts);
|
|
175
|
+
|
|
176
|
+
return cljs.core._write(writer,"]");
|
|
177
|
+
});
|
|
178
|
+
if((typeof reagent !== 'undefined') && (typeof reagent.ratom !== 'undefined') && (typeof reagent.ratom.rea_queue !== 'undefined')){
|
|
179
|
+
} else {
|
|
180
|
+
reagent.ratom.rea_queue = null;
|
|
181
|
+
}
|
|
182
|
+
reagent.ratom.rea_enqueue = (function reagent$ratom$rea_enqueue(r){
|
|
183
|
+
if((reagent.ratom.rea_queue == null)){
|
|
184
|
+
(reagent.ratom.rea_queue = []);
|
|
185
|
+
|
|
186
|
+
reagent.impl.batching.schedule();
|
|
187
|
+
} else {
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return reagent.ratom.rea_queue.push(r);
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* @interface
|
|
195
|
+
*/
|
|
196
|
+
reagent.ratom.IReactiveAtom = function(){};
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* @constructor
|
|
201
|
+
* @implements {cljs.core.IWatchable}
|
|
202
|
+
* @implements {cljs.core.IAtom}
|
|
203
|
+
* @implements {cljs.core.IEquiv}
|
|
204
|
+
* @implements {cljs.core.IHash}
|
|
205
|
+
* @implements {cljs.core.IReset}
|
|
206
|
+
* @implements {cljs.core.ISwap}
|
|
207
|
+
* @implements {reagent.ratom.IReactiveAtom}
|
|
208
|
+
* @implements {cljs.core.IMeta}
|
|
209
|
+
* @implements {cljs.core.IDeref}
|
|
210
|
+
* @implements {cljs.core.IPrintWithWriter}
|
|
211
|
+
* @implements {cljs.core.IWithMeta}
|
|
212
|
+
*/
|
|
213
|
+
reagent.ratom.RAtom = (function (state,meta,validator,watches){
|
|
214
|
+
this.state = state;
|
|
215
|
+
this.meta = meta;
|
|
216
|
+
this.validator = validator;
|
|
217
|
+
this.watches = watches;
|
|
218
|
+
this.cljs$lang$protocol_mask$partition0$ = 2154201088;
|
|
219
|
+
this.cljs$lang$protocol_mask$partition1$ = 114690;
|
|
220
|
+
});
|
|
221
|
+
(reagent.ratom.RAtom.prototype.reagent$ratom$IReactiveAtom$ = cljs.core.PROTOCOL_SENTINEL);
|
|
222
|
+
|
|
223
|
+
(reagent.ratom.RAtom.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (a,w,opts){
|
|
224
|
+
var self__ = this;
|
|
225
|
+
var a__$1 = this;
|
|
226
|
+
return reagent.ratom.pr_atom(a__$1,w,opts,"RAtom",new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"val","val",128701612),a__$1.cljs$core$IDeref$_deref$arity$1(null)], null));
|
|
227
|
+
}));
|
|
228
|
+
|
|
229
|
+
(reagent.ratom.RAtom.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_){
|
|
230
|
+
var self__ = this;
|
|
231
|
+
var ___$1 = this;
|
|
232
|
+
return self__.meta;
|
|
233
|
+
}));
|
|
234
|
+
|
|
235
|
+
(reagent.ratom.RAtom.prototype.cljs$core$IHash$_hash$arity$1 = (function (this$){
|
|
236
|
+
var self__ = this;
|
|
237
|
+
var this$__$1 = this;
|
|
238
|
+
return goog.getUid(this$__$1);
|
|
239
|
+
}));
|
|
240
|
+
|
|
241
|
+
(reagent.ratom.RAtom.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (o,other){
|
|
242
|
+
var self__ = this;
|
|
243
|
+
var o__$1 = this;
|
|
244
|
+
return (o__$1 === other);
|
|
245
|
+
}));
|
|
246
|
+
|
|
247
|
+
(reagent.ratom.RAtom.prototype.cljs$core$IReset$_reset_BANG_$arity$2 = (function (a,new_value){
|
|
248
|
+
var self__ = this;
|
|
249
|
+
var a__$1 = this;
|
|
250
|
+
if((self__.validator == null)){
|
|
251
|
+
} else {
|
|
252
|
+
if(cljs.core.truth_((self__.validator.cljs$core$IFn$_invoke$arity$1 ? self__.validator.cljs$core$IFn$_invoke$arity$1(new_value) : self__.validator.call(null,new_value)))){
|
|
253
|
+
} else {
|
|
254
|
+
throw (new Error(["Assert failed: ","Validator rejected reference state","\n","(validator new-value)"].join('')));
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
var old_value = self__.state;
|
|
259
|
+
(self__.state = new_value);
|
|
260
|
+
|
|
261
|
+
if((self__.watches == null)){
|
|
262
|
+
} else {
|
|
263
|
+
reagent.ratom.notify_w(a__$1,old_value,new_value);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
return new_value;
|
|
267
|
+
}));
|
|
268
|
+
|
|
269
|
+
(reagent.ratom.RAtom.prototype.cljs$core$ISwap$_swap_BANG_$arity$2 = (function (a,f){
|
|
270
|
+
var self__ = this;
|
|
271
|
+
var a__$1 = this;
|
|
272
|
+
return a__$1.cljs$core$IReset$_reset_BANG_$arity$2(null,(f.cljs$core$IFn$_invoke$arity$1 ? f.cljs$core$IFn$_invoke$arity$1(self__.state) : f.call(null,self__.state)));
|
|
273
|
+
}));
|
|
274
|
+
|
|
275
|
+
(reagent.ratom.RAtom.prototype.cljs$core$ISwap$_swap_BANG_$arity$3 = (function (a,f,x){
|
|
276
|
+
var self__ = this;
|
|
277
|
+
var a__$1 = this;
|
|
278
|
+
return a__$1.cljs$core$IReset$_reset_BANG_$arity$2(null,(f.cljs$core$IFn$_invoke$arity$2 ? f.cljs$core$IFn$_invoke$arity$2(self__.state,x) : f.call(null,self__.state,x)));
|
|
279
|
+
}));
|
|
280
|
+
|
|
281
|
+
(reagent.ratom.RAtom.prototype.cljs$core$ISwap$_swap_BANG_$arity$4 = (function (a,f,x,y){
|
|
282
|
+
var self__ = this;
|
|
283
|
+
var a__$1 = this;
|
|
284
|
+
return a__$1.cljs$core$IReset$_reset_BANG_$arity$2(null,(f.cljs$core$IFn$_invoke$arity$3 ? f.cljs$core$IFn$_invoke$arity$3(self__.state,x,y) : f.call(null,self__.state,x,y)));
|
|
285
|
+
}));
|
|
286
|
+
|
|
287
|
+
(reagent.ratom.RAtom.prototype.cljs$core$ISwap$_swap_BANG_$arity$5 = (function (a,f,x,y,more){
|
|
288
|
+
var self__ = this;
|
|
289
|
+
var a__$1 = this;
|
|
290
|
+
return a__$1.cljs$core$IReset$_reset_BANG_$arity$2(null,cljs.core.apply.cljs$core$IFn$_invoke$arity$5(f,self__.state,x,y,more));
|
|
291
|
+
}));
|
|
292
|
+
|
|
293
|
+
(reagent.ratom.RAtom.prototype.cljs$core$IWatchable$_notify_watches$arity$3 = (function (this$,old,new$){
|
|
294
|
+
var self__ = this;
|
|
295
|
+
var this$__$1 = this;
|
|
296
|
+
return reagent.ratom.notify_w(this$__$1,old,new$);
|
|
297
|
+
}));
|
|
298
|
+
|
|
299
|
+
(reagent.ratom.RAtom.prototype.cljs$core$IWatchable$_add_watch$arity$3 = (function (this$,key,f){
|
|
300
|
+
var self__ = this;
|
|
301
|
+
var this$__$1 = this;
|
|
302
|
+
return reagent.ratom.add_w(this$__$1,key,f);
|
|
303
|
+
}));
|
|
304
|
+
|
|
305
|
+
(reagent.ratom.RAtom.prototype.cljs$core$IWatchable$_remove_watch$arity$2 = (function (this$,key){
|
|
306
|
+
var self__ = this;
|
|
307
|
+
var this$__$1 = this;
|
|
308
|
+
return reagent.ratom.remove_w(this$__$1,key);
|
|
309
|
+
}));
|
|
310
|
+
|
|
311
|
+
(reagent.ratom.RAtom.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_,new_meta){
|
|
312
|
+
var self__ = this;
|
|
313
|
+
var ___$1 = this;
|
|
314
|
+
return (new reagent.ratom.RAtom(self__.state,new_meta,self__.validator,self__.watches));
|
|
315
|
+
}));
|
|
316
|
+
|
|
317
|
+
(reagent.ratom.RAtom.prototype.cljs$core$IDeref$_deref$arity$1 = (function (this$){
|
|
318
|
+
var self__ = this;
|
|
319
|
+
var this$__$1 = this;
|
|
320
|
+
reagent.ratom.notify_deref_watcher_BANG_(this$__$1);
|
|
321
|
+
|
|
322
|
+
return self__.state;
|
|
323
|
+
}));
|
|
324
|
+
|
|
325
|
+
(reagent.ratom.RAtom.getBasis = (function (){
|
|
326
|
+
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.with_meta(new cljs.core.Symbol(null,"state","state",-348086572,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null)),new cljs.core.Symbol(null,"meta","meta",-1154898805,null),new cljs.core.Symbol(null,"validator","validator",-325659154,null),cljs.core.with_meta(new cljs.core.Symbol(null,"watches","watches",1367433992,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null))], null);
|
|
327
|
+
}));
|
|
328
|
+
|
|
329
|
+
(reagent.ratom.RAtom.cljs$lang$type = true);
|
|
330
|
+
|
|
331
|
+
(reagent.ratom.RAtom.cljs$lang$ctorStr = "reagent.ratom/RAtom");
|
|
332
|
+
|
|
333
|
+
(reagent.ratom.RAtom.cljs$lang$ctorPrWriter = (function (this__5287__auto__,writer__5288__auto__,opt__5289__auto__){
|
|
334
|
+
return cljs.core._write(writer__5288__auto__,"reagent.ratom/RAtom");
|
|
335
|
+
}));
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Positional factory function for reagent.ratom/RAtom.
|
|
339
|
+
*/
|
|
340
|
+
reagent.ratom.__GT_RAtom = (function reagent$ratom$__GT_RAtom(state,meta,validator,watches){
|
|
341
|
+
return (new reagent.ratom.RAtom(state,meta,validator,watches));
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Like clojure.core/atom, except that it keeps track of derefs.
|
|
346
|
+
*/
|
|
347
|
+
reagent.ratom.atom = (function reagent$ratom$atom(var_args){
|
|
348
|
+
var G__11960 = arguments.length;
|
|
349
|
+
switch (G__11960) {
|
|
350
|
+
case 1:
|
|
351
|
+
return reagent.ratom.atom.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));
|
|
352
|
+
|
|
353
|
+
break;
|
|
354
|
+
default:
|
|
355
|
+
var args_arr__5751__auto__ = [];
|
|
356
|
+
var len__5726__auto___12337 = arguments.length;
|
|
357
|
+
var i__5727__auto___12338 = (0);
|
|
358
|
+
while(true){
|
|
359
|
+
if((i__5727__auto___12338 < len__5726__auto___12337)){
|
|
360
|
+
args_arr__5751__auto__.push((arguments[i__5727__auto___12338]));
|
|
361
|
+
|
|
362
|
+
var G__12339 = (i__5727__auto___12338 + (1));
|
|
363
|
+
i__5727__auto___12338 = G__12339;
|
|
364
|
+
continue;
|
|
365
|
+
} else {
|
|
366
|
+
}
|
|
367
|
+
break;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
var argseq__5752__auto__ = ((((1) < args_arr__5751__auto__.length))?(new cljs.core.IndexedSeq(args_arr__5751__auto__.slice((1)),(0),null)):null);
|
|
371
|
+
return reagent.ratom.atom.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__5752__auto__);
|
|
372
|
+
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
(reagent.ratom.atom.cljs$core$IFn$_invoke$arity$1 = (function (x){
|
|
377
|
+
return reagent.ratom.__GT_RAtom(x,null,null,null);
|
|
378
|
+
}));
|
|
379
|
+
|
|
380
|
+
(reagent.ratom.atom.cljs$core$IFn$_invoke$arity$variadic = (function (x,p__11974){
|
|
381
|
+
var map__11975 = p__11974;
|
|
382
|
+
var map__11975__$1 = cljs.core.__destructure_map(map__11975);
|
|
383
|
+
var meta = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__11975__$1,new cljs.core.Keyword(null,"meta","meta",1499536964));
|
|
384
|
+
var validator = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__11975__$1,new cljs.core.Keyword(null,"validator","validator",-1966190681));
|
|
385
|
+
return reagent.ratom.__GT_RAtom(x,meta,validator,null);
|
|
386
|
+
}));
|
|
387
|
+
|
|
388
|
+
/** @this {Function} */
|
|
389
|
+
(reagent.ratom.atom.cljs$lang$applyTo = (function (seq11955){
|
|
390
|
+
var G__11956 = cljs.core.first(seq11955);
|
|
391
|
+
var seq11955__$1 = cljs.core.next(seq11955);
|
|
392
|
+
var self__5711__auto__ = this;
|
|
393
|
+
return self__5711__auto__.cljs$core$IFn$_invoke$arity$variadic(G__11956,seq11955__$1);
|
|
394
|
+
}));
|
|
395
|
+
|
|
396
|
+
(reagent.ratom.atom.cljs$lang$maxFixedArity = (1));
|
|
397
|
+
|
|
398
|
+
reagent.ratom.cached_reaction = (function reagent$ratom$cached_reaction(f,o,k,obj,destroy){
|
|
399
|
+
var m = o.reagReactionCache;
|
|
400
|
+
var m__$1 = (((m == null))?cljs.core.PersistentArrayMap.EMPTY:m);
|
|
401
|
+
var r = (m__$1.cljs$core$IFn$_invoke$arity$2 ? m__$1.cljs$core$IFn$_invoke$arity$2(k,null) : m__$1.call(null,k,null));
|
|
402
|
+
if((!((r == null)))){
|
|
403
|
+
return cljs.core._deref(r);
|
|
404
|
+
} else {
|
|
405
|
+
if((reagent.ratom._STAR_ratom_context_STAR_ == null)){
|
|
406
|
+
return (f.cljs$core$IFn$_invoke$arity$0 ? f.cljs$core$IFn$_invoke$arity$0() : f.call(null));
|
|
407
|
+
} else {
|
|
408
|
+
var r__$1 = (function (){var G__11998 = f;
|
|
409
|
+
var G__11999 = new cljs.core.Keyword(null,"on-dispose","on-dispose",2105306360);
|
|
410
|
+
var G__12000 = (function (x){
|
|
411
|
+
if(reagent.ratom.debug){
|
|
412
|
+
cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$2(reagent.ratom._running,cljs.core.dec);
|
|
413
|
+
} else {
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
var __12340 = o.reagReactionCache;
|
|
417
|
+
var __12341__$1 = cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(__12340,k);
|
|
418
|
+
(o.reagReactionCache = __12341__$1);
|
|
419
|
+
|
|
420
|
+
if((!((obj == null)))){
|
|
421
|
+
(obj.reaction = null);
|
|
422
|
+
} else {
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
if((!((destroy == null)))){
|
|
426
|
+
return (destroy.cljs$core$IFn$_invoke$arity$1 ? destroy.cljs$core$IFn$_invoke$arity$1(x) : destroy.call(null,x));
|
|
427
|
+
} else {
|
|
428
|
+
return null;
|
|
429
|
+
}
|
|
430
|
+
});
|
|
431
|
+
return (reagent.ratom.make_reaction.cljs$core$IFn$_invoke$arity$3 ? reagent.ratom.make_reaction.cljs$core$IFn$_invoke$arity$3(G__11998,G__11999,G__12000) : reagent.ratom.make_reaction.call(null,G__11998,G__11999,G__12000));
|
|
432
|
+
})();
|
|
433
|
+
var v = cljs.core._deref(r__$1);
|
|
434
|
+
(o.reagReactionCache = cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(m__$1,k,r__$1));
|
|
435
|
+
|
|
436
|
+
if(reagent.ratom.debug){
|
|
437
|
+
cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$2(reagent.ratom._running,cljs.core.inc);
|
|
438
|
+
} else {
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
if((!((obj == null)))){
|
|
442
|
+
(obj.reaction = r__$1);
|
|
443
|
+
} else {
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
return v;
|
|
447
|
+
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
});
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* @constructor
|
|
454
|
+
* @implements {cljs.core.IEquiv}
|
|
455
|
+
* @implements {cljs.core.IHash}
|
|
456
|
+
* @implements {reagent.ratom.IReactiveAtom}
|
|
457
|
+
* @implements {cljs.core.IDeref}
|
|
458
|
+
* @implements {cljs.core.IPrintWithWriter}
|
|
459
|
+
*/
|
|
460
|
+
reagent.ratom.Track = (function (f,args,reaction){
|
|
461
|
+
this.f = f;
|
|
462
|
+
this.args = args;
|
|
463
|
+
this.reaction = reaction;
|
|
464
|
+
this.cljs$lang$protocol_mask$partition0$ = 2153807872;
|
|
465
|
+
this.cljs$lang$protocol_mask$partition1$ = 0;
|
|
466
|
+
});
|
|
467
|
+
(reagent.ratom.Track.prototype.reagent$ratom$IReactiveAtom$ = cljs.core.PROTOCOL_SENTINEL);
|
|
468
|
+
|
|
469
|
+
(reagent.ratom.Track.prototype.cljs$core$IDeref$_deref$arity$1 = (function (this$){
|
|
470
|
+
var self__ = this;
|
|
471
|
+
var this$__$1 = this;
|
|
472
|
+
var temp__5806__auto__ = self__.reaction;
|
|
473
|
+
if((temp__5806__auto__ == null)){
|
|
474
|
+
return reagent.ratom.cached_reaction((function (){
|
|
475
|
+
return cljs.core.apply.cljs$core$IFn$_invoke$arity$2(self__.f,self__.args);
|
|
476
|
+
}),self__.f,self__.args,this$__$1,null);
|
|
477
|
+
} else {
|
|
478
|
+
var r = temp__5806__auto__;
|
|
479
|
+
return cljs.core._deref(r);
|
|
480
|
+
}
|
|
481
|
+
}));
|
|
482
|
+
|
|
483
|
+
(reagent.ratom.Track.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (_,other){
|
|
484
|
+
var self__ = this;
|
|
485
|
+
var ___$1 = this;
|
|
486
|
+
return (((other instanceof reagent.ratom.Track)) && (((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(self__.f,other.f)) && (cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(self__.args,other.args)))));
|
|
487
|
+
}));
|
|
488
|
+
|
|
489
|
+
(reagent.ratom.Track.prototype.cljs$core$IHash$_hash$arity$1 = (function (_){
|
|
490
|
+
var self__ = this;
|
|
491
|
+
var ___$1 = this;
|
|
492
|
+
return cljs.core.hash(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [self__.f,self__.args], null));
|
|
493
|
+
}));
|
|
494
|
+
|
|
495
|
+
(reagent.ratom.Track.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (a,w,opts){
|
|
496
|
+
var self__ = this;
|
|
497
|
+
var a__$1 = this;
|
|
498
|
+
return reagent.ratom.pr_atom(a__$1,w,opts,"Track",new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"val","val",128701612),a__$1.cljs$core$IDeref$_deref$arity$1(null),new cljs.core.Keyword(null,"f","f",-1597136552),self__.f], null));
|
|
499
|
+
}));
|
|
500
|
+
|
|
501
|
+
(reagent.ratom.Track.getBasis = (function (){
|
|
502
|
+
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"f","f",43394975,null),new cljs.core.Symbol(null,"args","args",-1338879193,null),cljs.core.with_meta(new cljs.core.Symbol(null,"reaction","reaction",2131401315,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null))], null);
|
|
503
|
+
}));
|
|
504
|
+
|
|
505
|
+
(reagent.ratom.Track.cljs$lang$type = true);
|
|
506
|
+
|
|
507
|
+
(reagent.ratom.Track.cljs$lang$ctorStr = "reagent.ratom/Track");
|
|
508
|
+
|
|
509
|
+
(reagent.ratom.Track.cljs$lang$ctorPrWriter = (function (this__5287__auto__,writer__5288__auto__,opt__5289__auto__){
|
|
510
|
+
return cljs.core._write(writer__5288__auto__,"reagent.ratom/Track");
|
|
511
|
+
}));
|
|
512
|
+
|
|
513
|
+
/**
|
|
514
|
+
* Positional factory function for reagent.ratom/Track.
|
|
515
|
+
*/
|
|
516
|
+
reagent.ratom.__GT_Track = (function reagent$ratom$__GT_Track(f,args,reaction){
|
|
517
|
+
return (new reagent.ratom.Track(f,args,reaction));
|
|
518
|
+
});
|
|
519
|
+
|
|
520
|
+
reagent.ratom.make_track = (function reagent$ratom$make_track(f,args){
|
|
521
|
+
return (new reagent.ratom.Track(f,args,null));
|
|
522
|
+
});
|
|
523
|
+
reagent.ratom.make_track_BANG_ = (function reagent$ratom$make_track_BANG_(f,args){
|
|
524
|
+
var t = reagent.ratom.make_track(f,args);
|
|
525
|
+
var r = (function (){var G__12080 = (function (){
|
|
526
|
+
return t.cljs$core$IDeref$_deref$arity$1(null);
|
|
527
|
+
});
|
|
528
|
+
var G__12081 = new cljs.core.Keyword(null,"auto-run","auto-run",1958400437);
|
|
529
|
+
var G__12082 = true;
|
|
530
|
+
return (reagent.ratom.make_reaction.cljs$core$IFn$_invoke$arity$3 ? reagent.ratom.make_reaction.cljs$core$IFn$_invoke$arity$3(G__12080,G__12081,G__12082) : reagent.ratom.make_reaction.call(null,G__12080,G__12081,G__12082));
|
|
531
|
+
})();
|
|
532
|
+
cljs.core.deref(r);
|
|
533
|
+
|
|
534
|
+
return r;
|
|
535
|
+
});
|
|
536
|
+
reagent.ratom.track = (function reagent$ratom$track(var_args){
|
|
537
|
+
var args__5732__auto__ = [];
|
|
538
|
+
var len__5726__auto___12344 = arguments.length;
|
|
539
|
+
var i__5727__auto___12345 = (0);
|
|
540
|
+
while(true){
|
|
541
|
+
if((i__5727__auto___12345 < len__5726__auto___12344)){
|
|
542
|
+
args__5732__auto__.push((arguments[i__5727__auto___12345]));
|
|
543
|
+
|
|
544
|
+
var G__12346 = (i__5727__auto___12345 + (1));
|
|
545
|
+
i__5727__auto___12345 = G__12346;
|
|
546
|
+
continue;
|
|
547
|
+
} else {
|
|
548
|
+
}
|
|
549
|
+
break;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
var argseq__5733__auto__ = ((((1) < args__5732__auto__.length))?(new cljs.core.IndexedSeq(args__5732__auto__.slice((1)),(0),null)):null);
|
|
553
|
+
return reagent.ratom.track.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__5733__auto__);
|
|
554
|
+
});
|
|
555
|
+
|
|
556
|
+
(reagent.ratom.track.cljs$core$IFn$_invoke$arity$variadic = (function (f,args){
|
|
557
|
+
if(cljs.core.ifn_QMARK_(f)){
|
|
558
|
+
} else {
|
|
559
|
+
throw (new Error("Assert failed: (ifn? f)"));
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
return reagent.ratom.make_track(f,args);
|
|
563
|
+
}));
|
|
564
|
+
|
|
565
|
+
(reagent.ratom.track.cljs$lang$maxFixedArity = (1));
|
|
566
|
+
|
|
567
|
+
/** @this {Function} */
|
|
568
|
+
(reagent.ratom.track.cljs$lang$applyTo = (function (seq12097){
|
|
569
|
+
var G__12098 = cljs.core.first(seq12097);
|
|
570
|
+
var seq12097__$1 = cljs.core.next(seq12097);
|
|
571
|
+
var self__5711__auto__ = this;
|
|
572
|
+
return self__5711__auto__.cljs$core$IFn$_invoke$arity$variadic(G__12098,seq12097__$1);
|
|
573
|
+
}));
|
|
574
|
+
|
|
575
|
+
reagent.ratom.track_BANG_ = (function reagent$ratom$track_BANG_(var_args){
|
|
576
|
+
var args__5732__auto__ = [];
|
|
577
|
+
var len__5726__auto___12347 = arguments.length;
|
|
578
|
+
var i__5727__auto___12348 = (0);
|
|
579
|
+
while(true){
|
|
580
|
+
if((i__5727__auto___12348 < len__5726__auto___12347)){
|
|
581
|
+
args__5732__auto__.push((arguments[i__5727__auto___12348]));
|
|
582
|
+
|
|
583
|
+
var G__12349 = (i__5727__auto___12348 + (1));
|
|
584
|
+
i__5727__auto___12348 = G__12349;
|
|
585
|
+
continue;
|
|
586
|
+
} else {
|
|
587
|
+
}
|
|
588
|
+
break;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
var argseq__5733__auto__ = ((((1) < args__5732__auto__.length))?(new cljs.core.IndexedSeq(args__5732__auto__.slice((1)),(0),null)):null);
|
|
592
|
+
return reagent.ratom.track_BANG_.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__5733__auto__);
|
|
593
|
+
});
|
|
594
|
+
|
|
595
|
+
(reagent.ratom.track_BANG_.cljs$core$IFn$_invoke$arity$variadic = (function (f,args){
|
|
596
|
+
if(cljs.core.ifn_QMARK_(f)){
|
|
597
|
+
} else {
|
|
598
|
+
throw (new Error("Assert failed: (ifn? f)"));
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
return reagent.ratom.make_track_BANG_(f,args);
|
|
602
|
+
}));
|
|
603
|
+
|
|
604
|
+
(reagent.ratom.track_BANG_.cljs$lang$maxFixedArity = (1));
|
|
605
|
+
|
|
606
|
+
/** @this {Function} */
|
|
607
|
+
(reagent.ratom.track_BANG_.cljs$lang$applyTo = (function (seq12104){
|
|
608
|
+
var G__12105 = cljs.core.first(seq12104);
|
|
609
|
+
var seq12104__$1 = cljs.core.next(seq12104);
|
|
610
|
+
var self__5711__auto__ = this;
|
|
611
|
+
return self__5711__auto__.cljs$core$IFn$_invoke$arity$variadic(G__12105,seq12104__$1);
|
|
612
|
+
}));
|
|
613
|
+
|
|
614
|
+
|
|
615
|
+
/**
|
|
616
|
+
* @constructor
|
|
617
|
+
* @implements {cljs.core.IWatchable}
|
|
618
|
+
* @implements {cljs.core.IAtom}
|
|
619
|
+
* @implements {cljs.core.IEquiv}
|
|
620
|
+
* @implements {cljs.core.IHash}
|
|
621
|
+
* @implements {cljs.core.IReset}
|
|
622
|
+
* @implements {cljs.core.ISwap}
|
|
623
|
+
* @implements {reagent.ratom.IReactiveAtom}
|
|
624
|
+
* @implements {cljs.core.IDeref}
|
|
625
|
+
* @implements {cljs.core.IPrintWithWriter}
|
|
626
|
+
*/
|
|
627
|
+
reagent.ratom.RCursor = (function (ratom,path,reaction,state,watches){
|
|
628
|
+
this.ratom = ratom;
|
|
629
|
+
this.path = path;
|
|
630
|
+
this.reaction = reaction;
|
|
631
|
+
this.state = state;
|
|
632
|
+
this.watches = watches;
|
|
633
|
+
this.cljs$lang$protocol_mask$partition0$ = 2153807872;
|
|
634
|
+
this.cljs$lang$protocol_mask$partition1$ = 114690;
|
|
635
|
+
});
|
|
636
|
+
(reagent.ratom.RCursor.prototype._peek = (function (){
|
|
637
|
+
var self__ = this;
|
|
638
|
+
var this$ = this;
|
|
639
|
+
var _STAR_ratom_context_STAR__orig_val__12111 = reagent.ratom._STAR_ratom_context_STAR_;
|
|
640
|
+
var _STAR_ratom_context_STAR__temp_val__12112 = null;
|
|
641
|
+
(reagent.ratom._STAR_ratom_context_STAR_ = _STAR_ratom_context_STAR__temp_val__12112);
|
|
642
|
+
|
|
643
|
+
try{return this$.cljs$core$IDeref$_deref$arity$1(null);
|
|
644
|
+
}finally {(reagent.ratom._STAR_ratom_context_STAR_ = _STAR_ratom_context_STAR__orig_val__12111);
|
|
645
|
+
}}));
|
|
646
|
+
|
|
647
|
+
(reagent.ratom.RCursor.prototype._set_state = (function (oldstate,newstate){
|
|
648
|
+
var self__ = this;
|
|
649
|
+
var this$ = this;
|
|
650
|
+
if((oldstate === newstate)){
|
|
651
|
+
return null;
|
|
652
|
+
} else {
|
|
653
|
+
(self__.state = newstate);
|
|
654
|
+
|
|
655
|
+
if((!((self__.watches == null)))){
|
|
656
|
+
return reagent.ratom.notify_w(this$,oldstate,newstate);
|
|
657
|
+
} else {
|
|
658
|
+
return null;
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
}));
|
|
662
|
+
|
|
663
|
+
(reagent.ratom.RCursor.prototype.reagent$ratom$IReactiveAtom$ = cljs.core.PROTOCOL_SENTINEL);
|
|
664
|
+
|
|
665
|
+
(reagent.ratom.RCursor.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (a,w,opts){
|
|
666
|
+
var self__ = this;
|
|
667
|
+
var a__$1 = this;
|
|
668
|
+
return reagent.ratom.pr_atom(a__$1,w,opts,"RCursor",new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"val","val",128701612),a__$1.cljs$core$IDeref$_deref$arity$1(null),new cljs.core.Keyword(null,"path","path",-188191168),self__.path], null));
|
|
669
|
+
}));
|
|
670
|
+
|
|
671
|
+
(reagent.ratom.RCursor.prototype.cljs$core$IHash$_hash$arity$1 = (function (_){
|
|
672
|
+
var self__ = this;
|
|
673
|
+
var ___$1 = this;
|
|
674
|
+
return cljs.core.hash(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [self__.ratom,self__.path], null));
|
|
675
|
+
}));
|
|
676
|
+
|
|
677
|
+
(reagent.ratom.RCursor.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (_,other){
|
|
678
|
+
var self__ = this;
|
|
679
|
+
var ___$1 = this;
|
|
680
|
+
return (((other instanceof reagent.ratom.RCursor)) && (((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(self__.path,other.path)) && (cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(self__.ratom,other.ratom)))));
|
|
681
|
+
}));
|
|
682
|
+
|
|
683
|
+
(reagent.ratom.RCursor.prototype.cljs$core$IReset$_reset_BANG_$arity$2 = (function (this$,new_value){
|
|
684
|
+
var self__ = this;
|
|
685
|
+
var this$__$1 = this;
|
|
686
|
+
var oldstate = self__.state;
|
|
687
|
+
this$__$1._set_state(oldstate,new_value);
|
|
688
|
+
|
|
689
|
+
if((((!((self__.ratom == null))))?(((((self__.ratom.cljs$lang$protocol_mask$partition0$ & (32768))) || ((cljs.core.PROTOCOL_SENTINEL === self__.ratom.cljs$core$IDeref$))))?true:(((!self__.ratom.cljs$lang$protocol_mask$partition0$))?cljs.core.native_satisfies_QMARK_(cljs.core.IDeref,self__.ratom):false)):cljs.core.native_satisfies_QMARK_(cljs.core.IDeref,self__.ratom))){
|
|
690
|
+
if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(self__.path,cljs.core.PersistentVector.EMPTY)){
|
|
691
|
+
cljs.core.reset_BANG_(self__.ratom,new_value);
|
|
692
|
+
} else {
|
|
693
|
+
cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$4(self__.ratom,cljs.core.assoc_in,self__.path,new_value);
|
|
694
|
+
}
|
|
695
|
+
} else {
|
|
696
|
+
(self__.ratom.cljs$core$IFn$_invoke$arity$2 ? self__.ratom.cljs$core$IFn$_invoke$arity$2(self__.path,new_value) : self__.ratom.call(null,self__.path,new_value));
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
return new_value;
|
|
700
|
+
}));
|
|
701
|
+
|
|
702
|
+
(reagent.ratom.RCursor.prototype.cljs$core$ISwap$_swap_BANG_$arity$2 = (function (a,f){
|
|
703
|
+
var self__ = this;
|
|
704
|
+
var a__$1 = this;
|
|
705
|
+
return a__$1.cljs$core$IReset$_reset_BANG_$arity$2(null,(function (){var G__12167 = a__$1._peek();
|
|
706
|
+
return (f.cljs$core$IFn$_invoke$arity$1 ? f.cljs$core$IFn$_invoke$arity$1(G__12167) : f.call(null,G__12167));
|
|
707
|
+
})());
|
|
708
|
+
}));
|
|
709
|
+
|
|
710
|
+
(reagent.ratom.RCursor.prototype.cljs$core$ISwap$_swap_BANG_$arity$3 = (function (a,f,x){
|
|
711
|
+
var self__ = this;
|
|
712
|
+
var a__$1 = this;
|
|
713
|
+
return a__$1.cljs$core$IReset$_reset_BANG_$arity$2(null,(function (){var G__12169 = a__$1._peek();
|
|
714
|
+
var G__12170 = x;
|
|
715
|
+
return (f.cljs$core$IFn$_invoke$arity$2 ? f.cljs$core$IFn$_invoke$arity$2(G__12169,G__12170) : f.call(null,G__12169,G__12170));
|
|
716
|
+
})());
|
|
717
|
+
}));
|
|
718
|
+
|
|
719
|
+
(reagent.ratom.RCursor.prototype.cljs$core$ISwap$_swap_BANG_$arity$4 = (function (a,f,x,y){
|
|
720
|
+
var self__ = this;
|
|
721
|
+
var a__$1 = this;
|
|
722
|
+
return a__$1.cljs$core$IReset$_reset_BANG_$arity$2(null,(function (){var G__12176 = a__$1._peek();
|
|
723
|
+
var G__12177 = x;
|
|
724
|
+
var G__12178 = y;
|
|
725
|
+
return (f.cljs$core$IFn$_invoke$arity$3 ? f.cljs$core$IFn$_invoke$arity$3(G__12176,G__12177,G__12178) : f.call(null,G__12176,G__12177,G__12178));
|
|
726
|
+
})());
|
|
727
|
+
}));
|
|
728
|
+
|
|
729
|
+
(reagent.ratom.RCursor.prototype.cljs$core$ISwap$_swap_BANG_$arity$5 = (function (a,f,x,y,more){
|
|
730
|
+
var self__ = this;
|
|
731
|
+
var a__$1 = this;
|
|
732
|
+
return a__$1.cljs$core$IReset$_reset_BANG_$arity$2(null,cljs.core.apply.cljs$core$IFn$_invoke$arity$5(f,a__$1._peek(),x,y,more));
|
|
733
|
+
}));
|
|
734
|
+
|
|
735
|
+
(reagent.ratom.RCursor.prototype.cljs$core$IWatchable$_notify_watches$arity$3 = (function (this$,old,new$){
|
|
736
|
+
var self__ = this;
|
|
737
|
+
var this$__$1 = this;
|
|
738
|
+
return reagent.ratom.notify_w(this$__$1,old,new$);
|
|
739
|
+
}));
|
|
740
|
+
|
|
741
|
+
(reagent.ratom.RCursor.prototype.cljs$core$IWatchable$_add_watch$arity$3 = (function (this$,key,f){
|
|
742
|
+
var self__ = this;
|
|
743
|
+
var this$__$1 = this;
|
|
744
|
+
return reagent.ratom.add_w(this$__$1,key,f);
|
|
745
|
+
}));
|
|
746
|
+
|
|
747
|
+
(reagent.ratom.RCursor.prototype.cljs$core$IWatchable$_remove_watch$arity$2 = (function (this$,key){
|
|
748
|
+
var self__ = this;
|
|
749
|
+
var this$__$1 = this;
|
|
750
|
+
return reagent.ratom.remove_w(this$__$1,key);
|
|
751
|
+
}));
|
|
752
|
+
|
|
753
|
+
(reagent.ratom.RCursor.prototype.cljs$core$IDeref$_deref$arity$1 = (function (this$){
|
|
754
|
+
var self__ = this;
|
|
755
|
+
var this$__$1 = this;
|
|
756
|
+
var oldstate = self__.state;
|
|
757
|
+
var newstate = (function (){var temp__5806__auto__ = self__.reaction;
|
|
758
|
+
if((temp__5806__auto__ == null)){
|
|
759
|
+
var f = (((((!((self__.ratom == null))))?(((((self__.ratom.cljs$lang$protocol_mask$partition0$ & (32768))) || ((cljs.core.PROTOCOL_SENTINEL === self__.ratom.cljs$core$IDeref$))))?true:(((!self__.ratom.cljs$lang$protocol_mask$partition0$))?cljs.core.native_satisfies_QMARK_(cljs.core.IDeref,self__.ratom):false)):cljs.core.native_satisfies_QMARK_(cljs.core.IDeref,self__.ratom)))?(function (){
|
|
760
|
+
return cljs.core.get_in.cljs$core$IFn$_invoke$arity$2(cljs.core.deref(self__.ratom),self__.path);
|
|
761
|
+
}):(function (){
|
|
762
|
+
return (self__.ratom.cljs$core$IFn$_invoke$arity$1 ? self__.ratom.cljs$core$IFn$_invoke$arity$1(self__.path) : self__.ratom.call(null,self__.path));
|
|
763
|
+
}));
|
|
764
|
+
return reagent.ratom.cached_reaction(f,self__.ratom,self__.path,this$__$1,null);
|
|
765
|
+
} else {
|
|
766
|
+
var r = temp__5806__auto__;
|
|
767
|
+
return cljs.core._deref(r);
|
|
768
|
+
}
|
|
769
|
+
})();
|
|
770
|
+
this$__$1._set_state(oldstate,newstate);
|
|
771
|
+
|
|
772
|
+
return newstate;
|
|
773
|
+
}));
|
|
774
|
+
|
|
775
|
+
(reagent.ratom.RCursor.getBasis = (function (){
|
|
776
|
+
return new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"ratom","ratom",1514010260,null),new cljs.core.Symbol(null,"path","path",1452340359,null),cljs.core.with_meta(new cljs.core.Symbol(null,"reaction","reaction",2131401315,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null)),cljs.core.with_meta(new cljs.core.Symbol(null,"state","state",-348086572,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null)),cljs.core.with_meta(new cljs.core.Symbol(null,"watches","watches",1367433992,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null))], null);
|
|
777
|
+
}));
|
|
778
|
+
|
|
779
|
+
(reagent.ratom.RCursor.cljs$lang$type = true);
|
|
780
|
+
|
|
781
|
+
(reagent.ratom.RCursor.cljs$lang$ctorStr = "reagent.ratom/RCursor");
|
|
782
|
+
|
|
783
|
+
(reagent.ratom.RCursor.cljs$lang$ctorPrWriter = (function (this__5287__auto__,writer__5288__auto__,opt__5289__auto__){
|
|
784
|
+
return cljs.core._write(writer__5288__auto__,"reagent.ratom/RCursor");
|
|
785
|
+
}));
|
|
786
|
+
|
|
787
|
+
/**
|
|
788
|
+
* Positional factory function for reagent.ratom/RCursor.
|
|
789
|
+
*/
|
|
790
|
+
reagent.ratom.__GT_RCursor = (function reagent$ratom$__GT_RCursor(ratom,path,reaction,state,watches){
|
|
791
|
+
return (new reagent.ratom.RCursor(ratom,path,reaction,state,watches));
|
|
792
|
+
});
|
|
793
|
+
|
|
794
|
+
reagent.ratom.cursor = (function reagent$ratom$cursor(src,path){
|
|
795
|
+
if((function (){var or__5002__auto__ = (((!((src == null))))?((((false) || ((cljs.core.PROTOCOL_SENTINEL === src.reagent$ratom$IReactiveAtom$))))?true:(((!src.cljs$lang$protocol_mask$partition$))?cljs.core.native_satisfies_QMARK_(reagent.ratom.IReactiveAtom,src):false)):cljs.core.native_satisfies_QMARK_(reagent.ratom.IReactiveAtom,src));
|
|
796
|
+
if(or__5002__auto__){
|
|
797
|
+
return or__5002__auto__;
|
|
798
|
+
} else {
|
|
799
|
+
return ((cljs.core.ifn_QMARK_(src)) && ((!(cljs.core.vector_QMARK_(src)))));
|
|
800
|
+
}
|
|
801
|
+
})()){
|
|
802
|
+
} else {
|
|
803
|
+
throw (new Error(["Assert failed: ",["src must be a reactive atom or a function, not ",cljs.core.pr_str.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([src], 0))," while attempting to get path: ",cljs.core.pr_str.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([path], 0))].join(''),"\n","(or (satisfies? IReactiveAtom src) (and (ifn? src) (not (vector? src))))"].join('')));
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
return reagent.ratom.__GT_RCursor(src,path,null,null,null);
|
|
807
|
+
});
|
|
808
|
+
reagent.ratom.with_let_destroy = (function reagent$ratom$with_let_destroy(v){
|
|
809
|
+
var temp__5808__auto__ = v.destroy;
|
|
810
|
+
if((temp__5808__auto__ == null)){
|
|
811
|
+
return null;
|
|
812
|
+
} else {
|
|
813
|
+
var f = temp__5808__auto__;
|
|
814
|
+
return (f.cljs$core$IFn$_invoke$arity$0 ? f.cljs$core$IFn$_invoke$arity$0() : f.call(null));
|
|
815
|
+
}
|
|
816
|
+
});
|
|
817
|
+
reagent.ratom.with_let_values = (function reagent$ratom$with_let_values(key){
|
|
818
|
+
var temp__5806__auto__ = reagent.ratom._STAR_ratom_context_STAR_;
|
|
819
|
+
if((temp__5806__auto__ == null)){
|
|
820
|
+
return [];
|
|
821
|
+
} else {
|
|
822
|
+
var c = temp__5806__auto__;
|
|
823
|
+
return reagent.ratom.cached_reaction((function (){
|
|
824
|
+
return [];
|
|
825
|
+
}),c,key,null,reagent.ratom.with_let_destroy);
|
|
826
|
+
}
|
|
827
|
+
});
|
|
828
|
+
|
|
829
|
+
/**
|
|
830
|
+
* @interface
|
|
831
|
+
*/
|
|
832
|
+
reagent.ratom.IDisposable = function(){};
|
|
833
|
+
|
|
834
|
+
var reagent$ratom$IDisposable$dispose_BANG_$dyn_12355 = (function (this$){
|
|
835
|
+
var x__5350__auto__ = (((this$ == null))?null:this$);
|
|
836
|
+
var m__5351__auto__ = (reagent.ratom.dispose_BANG_[goog.typeOf(x__5350__auto__)]);
|
|
837
|
+
if((!((m__5351__auto__ == null)))){
|
|
838
|
+
return (m__5351__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5351__auto__.cljs$core$IFn$_invoke$arity$1(this$) : m__5351__auto__.call(null,this$));
|
|
839
|
+
} else {
|
|
840
|
+
var m__5349__auto__ = (reagent.ratom.dispose_BANG_["_"]);
|
|
841
|
+
if((!((m__5349__auto__ == null)))){
|
|
842
|
+
return (m__5349__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5349__auto__.cljs$core$IFn$_invoke$arity$1(this$) : m__5349__auto__.call(null,this$));
|
|
843
|
+
} else {
|
|
844
|
+
throw cljs.core.missing_protocol("IDisposable.dispose!",this$);
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
});
|
|
848
|
+
reagent.ratom.dispose_BANG_ = (function reagent$ratom$dispose_BANG_(this$){
|
|
849
|
+
if((((!((this$ == null)))) && ((!((this$.reagent$ratom$IDisposable$dispose_BANG_$arity$1 == null)))))){
|
|
850
|
+
return this$.reagent$ratom$IDisposable$dispose_BANG_$arity$1(this$);
|
|
851
|
+
} else {
|
|
852
|
+
return reagent$ratom$IDisposable$dispose_BANG_$dyn_12355(this$);
|
|
853
|
+
}
|
|
854
|
+
});
|
|
855
|
+
|
|
856
|
+
var reagent$ratom$IDisposable$add_on_dispose_BANG_$dyn_12357 = (function (this$,f){
|
|
857
|
+
var x__5350__auto__ = (((this$ == null))?null:this$);
|
|
858
|
+
var m__5351__auto__ = (reagent.ratom.add_on_dispose_BANG_[goog.typeOf(x__5350__auto__)]);
|
|
859
|
+
if((!((m__5351__auto__ == null)))){
|
|
860
|
+
return (m__5351__auto__.cljs$core$IFn$_invoke$arity$2 ? m__5351__auto__.cljs$core$IFn$_invoke$arity$2(this$,f) : m__5351__auto__.call(null,this$,f));
|
|
861
|
+
} else {
|
|
862
|
+
var m__5349__auto__ = (reagent.ratom.add_on_dispose_BANG_["_"]);
|
|
863
|
+
if((!((m__5349__auto__ == null)))){
|
|
864
|
+
return (m__5349__auto__.cljs$core$IFn$_invoke$arity$2 ? m__5349__auto__.cljs$core$IFn$_invoke$arity$2(this$,f) : m__5349__auto__.call(null,this$,f));
|
|
865
|
+
} else {
|
|
866
|
+
throw cljs.core.missing_protocol("IDisposable.add-on-dispose!",this$);
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
});
|
|
870
|
+
reagent.ratom.add_on_dispose_BANG_ = (function reagent$ratom$add_on_dispose_BANG_(this$,f){
|
|
871
|
+
if((((!((this$ == null)))) && ((!((this$.reagent$ratom$IDisposable$add_on_dispose_BANG_$arity$2 == null)))))){
|
|
872
|
+
return this$.reagent$ratom$IDisposable$add_on_dispose_BANG_$arity$2(this$,f);
|
|
873
|
+
} else {
|
|
874
|
+
return reagent$ratom$IDisposable$add_on_dispose_BANG_$dyn_12357(this$,f);
|
|
875
|
+
}
|
|
876
|
+
});
|
|
877
|
+
|
|
878
|
+
|
|
879
|
+
/**
|
|
880
|
+
* @interface
|
|
881
|
+
*/
|
|
882
|
+
reagent.ratom.IRunnable = function(){};
|
|
883
|
+
|
|
884
|
+
var reagent$ratom$IRunnable$run$dyn_12358 = (function (this$){
|
|
885
|
+
var x__5350__auto__ = (((this$ == null))?null:this$);
|
|
886
|
+
var m__5351__auto__ = (reagent.ratom.run[goog.typeOf(x__5350__auto__)]);
|
|
887
|
+
if((!((m__5351__auto__ == null)))){
|
|
888
|
+
return (m__5351__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5351__auto__.cljs$core$IFn$_invoke$arity$1(this$) : m__5351__auto__.call(null,this$));
|
|
889
|
+
} else {
|
|
890
|
+
var m__5349__auto__ = (reagent.ratom.run["_"]);
|
|
891
|
+
if((!((m__5349__auto__ == null)))){
|
|
892
|
+
return (m__5349__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5349__auto__.cljs$core$IFn$_invoke$arity$1(this$) : m__5349__auto__.call(null,this$));
|
|
893
|
+
} else {
|
|
894
|
+
throw cljs.core.missing_protocol("IRunnable.run",this$);
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
});
|
|
898
|
+
reagent.ratom.run = (function reagent$ratom$run(this$){
|
|
899
|
+
if((((!((this$ == null)))) && ((!((this$.reagent$ratom$IRunnable$run$arity$1 == null)))))){
|
|
900
|
+
return this$.reagent$ratom$IRunnable$run$arity$1(this$);
|
|
901
|
+
} else {
|
|
902
|
+
return reagent$ratom$IRunnable$run$dyn_12358(this$);
|
|
903
|
+
}
|
|
904
|
+
});
|
|
905
|
+
|
|
906
|
+
reagent.ratom.handle_reaction_change = (function reagent$ratom$handle_reaction_change(this$,sender,old,new$){
|
|
907
|
+
return this$._handle_change(sender,old,new$);
|
|
908
|
+
});
|
|
909
|
+
|
|
910
|
+
/**
|
|
911
|
+
* @constructor
|
|
912
|
+
* @implements {cljs.core.IWatchable}
|
|
913
|
+
* @implements {cljs.core.IAtom}
|
|
914
|
+
* @implements {cljs.core.IEquiv}
|
|
915
|
+
* @implements {cljs.core.IHash}
|
|
916
|
+
* @implements {cljs.core.IReset}
|
|
917
|
+
* @implements {cljs.core.ISwap}
|
|
918
|
+
* @implements {reagent.ratom.IReactiveAtom}
|
|
919
|
+
* @implements {reagent.ratom.IRunnable}
|
|
920
|
+
* @implements {reagent.ratom.IDisposable}
|
|
921
|
+
* @implements {cljs.core.IDeref}
|
|
922
|
+
* @implements {cljs.core.IPrintWithWriter}
|
|
923
|
+
*/
|
|
924
|
+
reagent.ratom.Reaction = (function (f,state,dirty_QMARK_,nocache_QMARK_,watching,watches,auto_run,caught){
|
|
925
|
+
this.f = f;
|
|
926
|
+
this.state = state;
|
|
927
|
+
this.dirty_QMARK_ = dirty_QMARK_;
|
|
928
|
+
this.nocache_QMARK_ = nocache_QMARK_;
|
|
929
|
+
this.watching = watching;
|
|
930
|
+
this.watches = watches;
|
|
931
|
+
this.auto_run = auto_run;
|
|
932
|
+
this.caught = caught;
|
|
933
|
+
this.cljs$lang$protocol_mask$partition0$ = 2153807872;
|
|
934
|
+
this.cljs$lang$protocol_mask$partition1$ = 114690;
|
|
935
|
+
});
|
|
936
|
+
(reagent.ratom.Reaction.prototype._peek_at = (function (){
|
|
937
|
+
var self__ = this;
|
|
938
|
+
var this$ = this;
|
|
939
|
+
var _STAR_ratom_context_STAR__orig_val__12257 = reagent.ratom._STAR_ratom_context_STAR_;
|
|
940
|
+
var _STAR_ratom_context_STAR__temp_val__12258 = null;
|
|
941
|
+
(reagent.ratom._STAR_ratom_context_STAR_ = _STAR_ratom_context_STAR__temp_val__12258);
|
|
942
|
+
|
|
943
|
+
try{return this$.cljs$core$IDeref$_deref$arity$1(null);
|
|
944
|
+
}finally {(reagent.ratom._STAR_ratom_context_STAR_ = _STAR_ratom_context_STAR__orig_val__12257);
|
|
945
|
+
}}));
|
|
946
|
+
|
|
947
|
+
(reagent.ratom.Reaction.prototype._handle_change = (function (sender,oldval,newval){
|
|
948
|
+
var self__ = this;
|
|
949
|
+
var this$ = this;
|
|
950
|
+
if((((oldval === newval)) || (self__.dirty_QMARK_))){
|
|
951
|
+
return null;
|
|
952
|
+
} else {
|
|
953
|
+
if((self__.auto_run == null)){
|
|
954
|
+
(self__.dirty_QMARK_ = true);
|
|
955
|
+
|
|
956
|
+
return reagent.ratom.rea_enqueue(this$);
|
|
957
|
+
} else {
|
|
958
|
+
if(self__.auto_run === true){
|
|
959
|
+
return this$._run(false);
|
|
960
|
+
} else {
|
|
961
|
+
return (self__.auto_run.cljs$core$IFn$_invoke$arity$1 ? self__.auto_run.cljs$core$IFn$_invoke$arity$1(this$) : self__.auto_run.call(null,this$));
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
}));
|
|
966
|
+
|
|
967
|
+
(reagent.ratom.Reaction.prototype._update_watching = (function (derefed){
|
|
968
|
+
var self__ = this;
|
|
969
|
+
var this$ = this;
|
|
970
|
+
var new$ = cljs.core.set(derefed);
|
|
971
|
+
var old = cljs.core.set(self__.watching);
|
|
972
|
+
(self__.watching = derefed);
|
|
973
|
+
|
|
974
|
+
var seq__12259_12360 = cljs.core.seq(clojure.set.difference.cljs$core$IFn$_invoke$arity$2(new$,old));
|
|
975
|
+
var chunk__12260_12361 = null;
|
|
976
|
+
var count__12261_12362 = (0);
|
|
977
|
+
var i__12262_12363 = (0);
|
|
978
|
+
while(true){
|
|
979
|
+
if((i__12262_12363 < count__12261_12362)){
|
|
980
|
+
var w_12364 = chunk__12260_12361.cljs$core$IIndexed$_nth$arity$2(null,i__12262_12363);
|
|
981
|
+
cljs.core._add_watch(w_12364,this$,reagent.ratom.handle_reaction_change);
|
|
982
|
+
|
|
983
|
+
|
|
984
|
+
var G__12365 = seq__12259_12360;
|
|
985
|
+
var G__12366 = chunk__12260_12361;
|
|
986
|
+
var G__12367 = count__12261_12362;
|
|
987
|
+
var G__12368 = (i__12262_12363 + (1));
|
|
988
|
+
seq__12259_12360 = G__12365;
|
|
989
|
+
chunk__12260_12361 = G__12366;
|
|
990
|
+
count__12261_12362 = G__12367;
|
|
991
|
+
i__12262_12363 = G__12368;
|
|
992
|
+
continue;
|
|
993
|
+
} else {
|
|
994
|
+
var temp__5804__auto___12369 = cljs.core.seq(seq__12259_12360);
|
|
995
|
+
if(temp__5804__auto___12369){
|
|
996
|
+
var seq__12259_12370__$1 = temp__5804__auto___12369;
|
|
997
|
+
if(cljs.core.chunked_seq_QMARK_(seq__12259_12370__$1)){
|
|
998
|
+
var c__5525__auto___12371 = cljs.core.chunk_first(seq__12259_12370__$1);
|
|
999
|
+
var G__12372 = cljs.core.chunk_rest(seq__12259_12370__$1);
|
|
1000
|
+
var G__12373 = c__5525__auto___12371;
|
|
1001
|
+
var G__12374 = cljs.core.count(c__5525__auto___12371);
|
|
1002
|
+
var G__12375 = (0);
|
|
1003
|
+
seq__12259_12360 = G__12372;
|
|
1004
|
+
chunk__12260_12361 = G__12373;
|
|
1005
|
+
count__12261_12362 = G__12374;
|
|
1006
|
+
i__12262_12363 = G__12375;
|
|
1007
|
+
continue;
|
|
1008
|
+
} else {
|
|
1009
|
+
var w_12376 = cljs.core.first(seq__12259_12370__$1);
|
|
1010
|
+
cljs.core._add_watch(w_12376,this$,reagent.ratom.handle_reaction_change);
|
|
1011
|
+
|
|
1012
|
+
|
|
1013
|
+
var G__12377 = cljs.core.next(seq__12259_12370__$1);
|
|
1014
|
+
var G__12378 = null;
|
|
1015
|
+
var G__12379 = (0);
|
|
1016
|
+
var G__12380 = (0);
|
|
1017
|
+
seq__12259_12360 = G__12377;
|
|
1018
|
+
chunk__12260_12361 = G__12378;
|
|
1019
|
+
count__12261_12362 = G__12379;
|
|
1020
|
+
i__12262_12363 = G__12380;
|
|
1021
|
+
continue;
|
|
1022
|
+
}
|
|
1023
|
+
} else {
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
break;
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
var seq__12265 = cljs.core.seq(clojure.set.difference.cljs$core$IFn$_invoke$arity$2(old,new$));
|
|
1030
|
+
var chunk__12266 = null;
|
|
1031
|
+
var count__12267 = (0);
|
|
1032
|
+
var i__12268 = (0);
|
|
1033
|
+
while(true){
|
|
1034
|
+
if((i__12268 < count__12267)){
|
|
1035
|
+
var w = chunk__12266.cljs$core$IIndexed$_nth$arity$2(null,i__12268);
|
|
1036
|
+
cljs.core._remove_watch(w,this$);
|
|
1037
|
+
|
|
1038
|
+
|
|
1039
|
+
var G__12381 = seq__12265;
|
|
1040
|
+
var G__12382 = chunk__12266;
|
|
1041
|
+
var G__12383 = count__12267;
|
|
1042
|
+
var G__12384 = (i__12268 + (1));
|
|
1043
|
+
seq__12265 = G__12381;
|
|
1044
|
+
chunk__12266 = G__12382;
|
|
1045
|
+
count__12267 = G__12383;
|
|
1046
|
+
i__12268 = G__12384;
|
|
1047
|
+
continue;
|
|
1048
|
+
} else {
|
|
1049
|
+
var temp__5804__auto__ = cljs.core.seq(seq__12265);
|
|
1050
|
+
if(temp__5804__auto__){
|
|
1051
|
+
var seq__12265__$1 = temp__5804__auto__;
|
|
1052
|
+
if(cljs.core.chunked_seq_QMARK_(seq__12265__$1)){
|
|
1053
|
+
var c__5525__auto__ = cljs.core.chunk_first(seq__12265__$1);
|
|
1054
|
+
var G__12385 = cljs.core.chunk_rest(seq__12265__$1);
|
|
1055
|
+
var G__12386 = c__5525__auto__;
|
|
1056
|
+
var G__12387 = cljs.core.count(c__5525__auto__);
|
|
1057
|
+
var G__12388 = (0);
|
|
1058
|
+
seq__12265 = G__12385;
|
|
1059
|
+
chunk__12266 = G__12386;
|
|
1060
|
+
count__12267 = G__12387;
|
|
1061
|
+
i__12268 = G__12388;
|
|
1062
|
+
continue;
|
|
1063
|
+
} else {
|
|
1064
|
+
var w = cljs.core.first(seq__12265__$1);
|
|
1065
|
+
cljs.core._remove_watch(w,this$);
|
|
1066
|
+
|
|
1067
|
+
|
|
1068
|
+
var G__12389 = cljs.core.next(seq__12265__$1);
|
|
1069
|
+
var G__12390 = null;
|
|
1070
|
+
var G__12391 = (0);
|
|
1071
|
+
var G__12392 = (0);
|
|
1072
|
+
seq__12265 = G__12389;
|
|
1073
|
+
chunk__12266 = G__12390;
|
|
1074
|
+
count__12267 = G__12391;
|
|
1075
|
+
i__12268 = G__12392;
|
|
1076
|
+
continue;
|
|
1077
|
+
}
|
|
1078
|
+
} else {
|
|
1079
|
+
return null;
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
break;
|
|
1083
|
+
}
|
|
1084
|
+
}));
|
|
1085
|
+
|
|
1086
|
+
(reagent.ratom.Reaction.prototype._queued_run = (function (){
|
|
1087
|
+
var self__ = this;
|
|
1088
|
+
var this$ = this;
|
|
1089
|
+
if(((self__.dirty_QMARK_) && ((!((self__.watching == null)))))){
|
|
1090
|
+
return this$._run(true);
|
|
1091
|
+
} else {
|
|
1092
|
+
return null;
|
|
1093
|
+
}
|
|
1094
|
+
}));
|
|
1095
|
+
|
|
1096
|
+
(reagent.ratom.Reaction.prototype._try_capture = (function (f__$1){
|
|
1097
|
+
var self__ = this;
|
|
1098
|
+
var this$ = this;
|
|
1099
|
+
try{(self__.caught = null);
|
|
1100
|
+
|
|
1101
|
+
return reagent.ratom.deref_capture(f__$1,this$);
|
|
1102
|
+
}catch (e12275){var e = e12275;
|
|
1103
|
+
(self__.state = e);
|
|
1104
|
+
|
|
1105
|
+
(self__.caught = e);
|
|
1106
|
+
|
|
1107
|
+
return (self__.dirty_QMARK_ = false);
|
|
1108
|
+
}}));
|
|
1109
|
+
|
|
1110
|
+
(reagent.ratom.Reaction.prototype._run = (function (check){
|
|
1111
|
+
var self__ = this;
|
|
1112
|
+
var this$ = this;
|
|
1113
|
+
var oldstate = self__.state;
|
|
1114
|
+
var res = (cljs.core.truth_(check)?this$._try_capture(self__.f):reagent.ratom.deref_capture(self__.f,this$));
|
|
1115
|
+
if(self__.nocache_QMARK_){
|
|
1116
|
+
} else {
|
|
1117
|
+
(self__.state = res);
|
|
1118
|
+
|
|
1119
|
+
if((((self__.watches == null)) || (cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(oldstate,res)))){
|
|
1120
|
+
} else {
|
|
1121
|
+
reagent.ratom.notify_w(this$,oldstate,res);
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
return res;
|
|
1126
|
+
}));
|
|
1127
|
+
|
|
1128
|
+
(reagent.ratom.Reaction.prototype._set_opts = (function (p__12276){
|
|
1129
|
+
var self__ = this;
|
|
1130
|
+
var map__12277 = p__12276;
|
|
1131
|
+
var map__12277__$1 = cljs.core.__destructure_map(map__12277);
|
|
1132
|
+
var auto_run__$1 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__12277__$1,new cljs.core.Keyword(null,"auto-run","auto-run",1958400437));
|
|
1133
|
+
var on_set = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__12277__$1,new cljs.core.Keyword(null,"on-set","on-set",-140953470));
|
|
1134
|
+
var on_dispose = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__12277__$1,new cljs.core.Keyword(null,"on-dispose","on-dispose",2105306360));
|
|
1135
|
+
var no_cache = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__12277__$1,new cljs.core.Keyword(null,"no-cache","no-cache",1588056370));
|
|
1136
|
+
var this$ = this;
|
|
1137
|
+
if((!((auto_run__$1 == null)))){
|
|
1138
|
+
(this$.auto_run = auto_run__$1);
|
|
1139
|
+
} else {
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
if((!((on_set == null)))){
|
|
1143
|
+
(this$.on_set = on_set);
|
|
1144
|
+
} else {
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
if((!((on_dispose == null)))){
|
|
1148
|
+
(this$.on_dispose = on_dispose);
|
|
1149
|
+
} else {
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
if((!((no_cache == null)))){
|
|
1153
|
+
return (this$.nocache_QMARK_ = no_cache);
|
|
1154
|
+
} else {
|
|
1155
|
+
return null;
|
|
1156
|
+
}
|
|
1157
|
+
}));
|
|
1158
|
+
|
|
1159
|
+
(reagent.ratom.Reaction.prototype.reagent$ratom$IReactiveAtom$ = cljs.core.PROTOCOL_SENTINEL);
|
|
1160
|
+
|
|
1161
|
+
(reagent.ratom.Reaction.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (a,w,opts){
|
|
1162
|
+
var self__ = this;
|
|
1163
|
+
var a__$1 = this;
|
|
1164
|
+
return reagent.ratom.pr_atom(a__$1,w,opts,"Reaction",new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"val","val",128701612),a__$1.cljs$core$IDeref$_deref$arity$1(null)], null));
|
|
1165
|
+
}));
|
|
1166
|
+
|
|
1167
|
+
(reagent.ratom.Reaction.prototype.cljs$core$IHash$_hash$arity$1 = (function (this$){
|
|
1168
|
+
var self__ = this;
|
|
1169
|
+
var this$__$1 = this;
|
|
1170
|
+
return goog.getUid(this$__$1);
|
|
1171
|
+
}));
|
|
1172
|
+
|
|
1173
|
+
(reagent.ratom.Reaction.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (o,other){
|
|
1174
|
+
var self__ = this;
|
|
1175
|
+
var o__$1 = this;
|
|
1176
|
+
return (o__$1 === other);
|
|
1177
|
+
}));
|
|
1178
|
+
|
|
1179
|
+
(reagent.ratom.Reaction.prototype.reagent$ratom$IDisposable$ = cljs.core.PROTOCOL_SENTINEL);
|
|
1180
|
+
|
|
1181
|
+
(reagent.ratom.Reaction.prototype.reagent$ratom$IDisposable$dispose_BANG_$arity$1 = (function (this$){
|
|
1182
|
+
var self__ = this;
|
|
1183
|
+
var this$__$1 = this;
|
|
1184
|
+
var s = self__.state;
|
|
1185
|
+
var wg = self__.watching;
|
|
1186
|
+
(self__.watching = null);
|
|
1187
|
+
|
|
1188
|
+
(self__.state = null);
|
|
1189
|
+
|
|
1190
|
+
(self__.auto_run = null);
|
|
1191
|
+
|
|
1192
|
+
(self__.dirty_QMARK_ = true);
|
|
1193
|
+
|
|
1194
|
+
var seq__12279_12394 = cljs.core.seq(cljs.core.set(wg));
|
|
1195
|
+
var chunk__12280_12395 = null;
|
|
1196
|
+
var count__12281_12396 = (0);
|
|
1197
|
+
var i__12282_12397 = (0);
|
|
1198
|
+
while(true){
|
|
1199
|
+
if((i__12282_12397 < count__12281_12396)){
|
|
1200
|
+
var w_12398 = chunk__12280_12395.cljs$core$IIndexed$_nth$arity$2(null,i__12282_12397);
|
|
1201
|
+
cljs.core._remove_watch(w_12398,this$__$1);
|
|
1202
|
+
|
|
1203
|
+
|
|
1204
|
+
var G__12399 = seq__12279_12394;
|
|
1205
|
+
var G__12400 = chunk__12280_12395;
|
|
1206
|
+
var G__12401 = count__12281_12396;
|
|
1207
|
+
var G__12402 = (i__12282_12397 + (1));
|
|
1208
|
+
seq__12279_12394 = G__12399;
|
|
1209
|
+
chunk__12280_12395 = G__12400;
|
|
1210
|
+
count__12281_12396 = G__12401;
|
|
1211
|
+
i__12282_12397 = G__12402;
|
|
1212
|
+
continue;
|
|
1213
|
+
} else {
|
|
1214
|
+
var temp__5804__auto___12403 = cljs.core.seq(seq__12279_12394);
|
|
1215
|
+
if(temp__5804__auto___12403){
|
|
1216
|
+
var seq__12279_12404__$1 = temp__5804__auto___12403;
|
|
1217
|
+
if(cljs.core.chunked_seq_QMARK_(seq__12279_12404__$1)){
|
|
1218
|
+
var c__5525__auto___12405 = cljs.core.chunk_first(seq__12279_12404__$1);
|
|
1219
|
+
var G__12406 = cljs.core.chunk_rest(seq__12279_12404__$1);
|
|
1220
|
+
var G__12407 = c__5525__auto___12405;
|
|
1221
|
+
var G__12408 = cljs.core.count(c__5525__auto___12405);
|
|
1222
|
+
var G__12409 = (0);
|
|
1223
|
+
seq__12279_12394 = G__12406;
|
|
1224
|
+
chunk__12280_12395 = G__12407;
|
|
1225
|
+
count__12281_12396 = G__12408;
|
|
1226
|
+
i__12282_12397 = G__12409;
|
|
1227
|
+
continue;
|
|
1228
|
+
} else {
|
|
1229
|
+
var w_12410 = cljs.core.first(seq__12279_12404__$1);
|
|
1230
|
+
cljs.core._remove_watch(w_12410,this$__$1);
|
|
1231
|
+
|
|
1232
|
+
|
|
1233
|
+
var G__12411 = cljs.core.next(seq__12279_12404__$1);
|
|
1234
|
+
var G__12412 = null;
|
|
1235
|
+
var G__12413 = (0);
|
|
1236
|
+
var G__12414 = (0);
|
|
1237
|
+
seq__12279_12394 = G__12411;
|
|
1238
|
+
chunk__12280_12395 = G__12412;
|
|
1239
|
+
count__12281_12396 = G__12413;
|
|
1240
|
+
i__12282_12397 = G__12414;
|
|
1241
|
+
continue;
|
|
1242
|
+
}
|
|
1243
|
+
} else {
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
break;
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
if((!((this$__$1.on_dispose == null)))){
|
|
1250
|
+
this$__$1.on_dispose(s);
|
|
1251
|
+
} else {
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
var temp__5808__auto__ = this$__$1.on_dispose_arr;
|
|
1255
|
+
if((temp__5808__auto__ == null)){
|
|
1256
|
+
return null;
|
|
1257
|
+
} else {
|
|
1258
|
+
var a = temp__5808__auto__;
|
|
1259
|
+
var n__5593__auto__ = a.length;
|
|
1260
|
+
var i = (0);
|
|
1261
|
+
while(true){
|
|
1262
|
+
if((i < n__5593__auto__)){
|
|
1263
|
+
var fexpr__12287_12415 = (a[i]);
|
|
1264
|
+
(fexpr__12287_12415.cljs$core$IFn$_invoke$arity$1 ? fexpr__12287_12415.cljs$core$IFn$_invoke$arity$1(this$__$1) : fexpr__12287_12415.call(null,this$__$1));
|
|
1265
|
+
|
|
1266
|
+
var G__12416 = (i + (1));
|
|
1267
|
+
i = G__12416;
|
|
1268
|
+
continue;
|
|
1269
|
+
} else {
|
|
1270
|
+
return null;
|
|
1271
|
+
}
|
|
1272
|
+
break;
|
|
1273
|
+
}
|
|
1274
|
+
}
|
|
1275
|
+
}));
|
|
1276
|
+
|
|
1277
|
+
(reagent.ratom.Reaction.prototype.reagent$ratom$IDisposable$add_on_dispose_BANG_$arity$2 = (function (this$,f__$1){
|
|
1278
|
+
var self__ = this;
|
|
1279
|
+
var this$__$1 = this;
|
|
1280
|
+
var temp__5806__auto__ = this$__$1.on_dispose_arr;
|
|
1281
|
+
if((temp__5806__auto__ == null)){
|
|
1282
|
+
return (this$__$1.on_dispose_arr = [f__$1]);
|
|
1283
|
+
} else {
|
|
1284
|
+
var a = temp__5806__auto__;
|
|
1285
|
+
return a.push(f__$1);
|
|
1286
|
+
}
|
|
1287
|
+
}));
|
|
1288
|
+
|
|
1289
|
+
(reagent.ratom.Reaction.prototype.cljs$core$IReset$_reset_BANG_$arity$2 = (function (a,newval){
|
|
1290
|
+
var self__ = this;
|
|
1291
|
+
var a__$1 = this;
|
|
1292
|
+
if(cljs.core.fn_QMARK_(a__$1.on_set)){
|
|
1293
|
+
} else {
|
|
1294
|
+
throw (new Error(["Assert failed: ","Reaction is read only; on-set is not allowed","\n","(fn? (.-on-set a))"].join('')));
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
var oldval = self__.state;
|
|
1298
|
+
(self__.state = newval);
|
|
1299
|
+
|
|
1300
|
+
a__$1.on_set(oldval,newval);
|
|
1301
|
+
|
|
1302
|
+
reagent.ratom.notify_w(a__$1,oldval,newval);
|
|
1303
|
+
|
|
1304
|
+
return newval;
|
|
1305
|
+
}));
|
|
1306
|
+
|
|
1307
|
+
(reagent.ratom.Reaction.prototype.cljs$core$ISwap$_swap_BANG_$arity$2 = (function (a,f__$1){
|
|
1308
|
+
var self__ = this;
|
|
1309
|
+
var a__$1 = this;
|
|
1310
|
+
return a__$1.cljs$core$IReset$_reset_BANG_$arity$2(null,(function (){var G__12289 = a__$1._peek_at();
|
|
1311
|
+
return (f__$1.cljs$core$IFn$_invoke$arity$1 ? f__$1.cljs$core$IFn$_invoke$arity$1(G__12289) : f__$1.call(null,G__12289));
|
|
1312
|
+
})());
|
|
1313
|
+
}));
|
|
1314
|
+
|
|
1315
|
+
(reagent.ratom.Reaction.prototype.cljs$core$ISwap$_swap_BANG_$arity$3 = (function (a,f__$1,x){
|
|
1316
|
+
var self__ = this;
|
|
1317
|
+
var a__$1 = this;
|
|
1318
|
+
return a__$1.cljs$core$IReset$_reset_BANG_$arity$2(null,(function (){var G__12291 = a__$1._peek_at();
|
|
1319
|
+
var G__12292 = x;
|
|
1320
|
+
return (f__$1.cljs$core$IFn$_invoke$arity$2 ? f__$1.cljs$core$IFn$_invoke$arity$2(G__12291,G__12292) : f__$1.call(null,G__12291,G__12292));
|
|
1321
|
+
})());
|
|
1322
|
+
}));
|
|
1323
|
+
|
|
1324
|
+
(reagent.ratom.Reaction.prototype.cljs$core$ISwap$_swap_BANG_$arity$4 = (function (a,f__$1,x,y){
|
|
1325
|
+
var self__ = this;
|
|
1326
|
+
var a__$1 = this;
|
|
1327
|
+
return a__$1.cljs$core$IReset$_reset_BANG_$arity$2(null,(function (){var G__12293 = a__$1._peek_at();
|
|
1328
|
+
var G__12294 = x;
|
|
1329
|
+
var G__12295 = y;
|
|
1330
|
+
return (f__$1.cljs$core$IFn$_invoke$arity$3 ? f__$1.cljs$core$IFn$_invoke$arity$3(G__12293,G__12294,G__12295) : f__$1.call(null,G__12293,G__12294,G__12295));
|
|
1331
|
+
})());
|
|
1332
|
+
}));
|
|
1333
|
+
|
|
1334
|
+
(reagent.ratom.Reaction.prototype.cljs$core$ISwap$_swap_BANG_$arity$5 = (function (a,f__$1,x,y,more){
|
|
1335
|
+
var self__ = this;
|
|
1336
|
+
var a__$1 = this;
|
|
1337
|
+
return a__$1.cljs$core$IReset$_reset_BANG_$arity$2(null,cljs.core.apply.cljs$core$IFn$_invoke$arity$5(f__$1,a__$1._peek_at(),x,y,more));
|
|
1338
|
+
}));
|
|
1339
|
+
|
|
1340
|
+
(reagent.ratom.Reaction.prototype.reagent$ratom$IRunnable$ = cljs.core.PROTOCOL_SENTINEL);
|
|
1341
|
+
|
|
1342
|
+
(reagent.ratom.Reaction.prototype.reagent$ratom$IRunnable$run$arity$1 = (function (this$){
|
|
1343
|
+
var self__ = this;
|
|
1344
|
+
var this$__$1 = this;
|
|
1345
|
+
(reagent.ratom.flush_BANG_.cljs$core$IFn$_invoke$arity$0 ? reagent.ratom.flush_BANG_.cljs$core$IFn$_invoke$arity$0() : reagent.ratom.flush_BANG_.call(null));
|
|
1346
|
+
|
|
1347
|
+
return this$__$1._run(false);
|
|
1348
|
+
}));
|
|
1349
|
+
|
|
1350
|
+
(reagent.ratom.Reaction.prototype.cljs$core$IWatchable$_notify_watches$arity$3 = (function (this$,old,new$){
|
|
1351
|
+
var self__ = this;
|
|
1352
|
+
var this$__$1 = this;
|
|
1353
|
+
return reagent.ratom.notify_w(this$__$1,old,new$);
|
|
1354
|
+
}));
|
|
1355
|
+
|
|
1356
|
+
(reagent.ratom.Reaction.prototype.cljs$core$IWatchable$_add_watch$arity$3 = (function (this$,key,f__$1){
|
|
1357
|
+
var self__ = this;
|
|
1358
|
+
var this$__$1 = this;
|
|
1359
|
+
return reagent.ratom.add_w(this$__$1,key,f__$1);
|
|
1360
|
+
}));
|
|
1361
|
+
|
|
1362
|
+
(reagent.ratom.Reaction.prototype.cljs$core$IWatchable$_remove_watch$arity$2 = (function (this$,key){
|
|
1363
|
+
var self__ = this;
|
|
1364
|
+
var this$__$1 = this;
|
|
1365
|
+
var was_empty = cljs.core.empty_QMARK_(self__.watches);
|
|
1366
|
+
reagent.ratom.remove_w(this$__$1,key);
|
|
1367
|
+
|
|
1368
|
+
if((((!(was_empty))) && (((cljs.core.empty_QMARK_(self__.watches)) && ((self__.auto_run == null)))))){
|
|
1369
|
+
return this$__$1.reagent$ratom$IDisposable$dispose_BANG_$arity$1(null);
|
|
1370
|
+
} else {
|
|
1371
|
+
return null;
|
|
1372
|
+
}
|
|
1373
|
+
}));
|
|
1374
|
+
|
|
1375
|
+
(reagent.ratom.Reaction.prototype.cljs$core$IDeref$_deref$arity$1 = (function (this$){
|
|
1376
|
+
var self__ = this;
|
|
1377
|
+
var this$__$1 = this;
|
|
1378
|
+
var temp__5808__auto___12417 = self__.caught;
|
|
1379
|
+
if((temp__5808__auto___12417 == null)){
|
|
1380
|
+
} else {
|
|
1381
|
+
var e_12418 = temp__5808__auto___12417;
|
|
1382
|
+
throw e_12418;
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
var non_reactive_12419 = (reagent.ratom._STAR_ratom_context_STAR_ == null);
|
|
1386
|
+
if(non_reactive_12419){
|
|
1387
|
+
(reagent.ratom.flush_BANG_.cljs$core$IFn$_invoke$arity$0 ? reagent.ratom.flush_BANG_.cljs$core$IFn$_invoke$arity$0() : reagent.ratom.flush_BANG_.call(null));
|
|
1388
|
+
} else {
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
if(((non_reactive_12419) && ((self__.auto_run == null)))){
|
|
1392
|
+
if(self__.dirty_QMARK_){
|
|
1393
|
+
var oldstate_12420 = self__.state;
|
|
1394
|
+
(self__.state = (self__.f.cljs$core$IFn$_invoke$arity$0 ? self__.f.cljs$core$IFn$_invoke$arity$0() : self__.f.call(null)));
|
|
1395
|
+
|
|
1396
|
+
if((((self__.watches == null)) || (cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(oldstate_12420,self__.state)))){
|
|
1397
|
+
} else {
|
|
1398
|
+
reagent.ratom.notify_w(this$__$1,oldstate_12420,self__.state);
|
|
1399
|
+
}
|
|
1400
|
+
} else {
|
|
1401
|
+
}
|
|
1402
|
+
} else {
|
|
1403
|
+
reagent.ratom.notify_deref_watcher_BANG_(this$__$1);
|
|
1404
|
+
|
|
1405
|
+
if(self__.dirty_QMARK_){
|
|
1406
|
+
this$__$1._run(false);
|
|
1407
|
+
} else {
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
return self__.state;
|
|
1412
|
+
}));
|
|
1413
|
+
|
|
1414
|
+
(reagent.ratom.Reaction.getBasis = (function (){
|
|
1415
|
+
return new cljs.core.PersistentVector(null, 8, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"f","f",43394975,null),cljs.core.with_meta(new cljs.core.Symbol(null,"state","state",-348086572,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null)),cljs.core.with_meta(new cljs.core.Symbol(null,"dirty?","dirty?",-419314319,null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"tag","tag",-1290361223),new cljs.core.Symbol(null,"boolean","boolean",-278886877,null),new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null)),cljs.core.with_meta(new cljs.core.Symbol(null,"nocache?","nocache?",-1065670978,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"tag","tag",-1290361223),new cljs.core.Symbol(null,"boolean","boolean",-278886877,null)], null)),cljs.core.with_meta(new cljs.core.Symbol(null,"watching","watching",1947648227,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null)),cljs.core.with_meta(new cljs.core.Symbol(null,"watches","watches",1367433992,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null)),cljs.core.with_meta(new cljs.core.Symbol(null,"auto-run","auto-run",-696035332,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null)),cljs.core.with_meta(new cljs.core.Symbol(null,"caught","caught",2084008322,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null))], null);
|
|
1416
|
+
}));
|
|
1417
|
+
|
|
1418
|
+
(reagent.ratom.Reaction.cljs$lang$type = true);
|
|
1419
|
+
|
|
1420
|
+
(reagent.ratom.Reaction.cljs$lang$ctorStr = "reagent.ratom/Reaction");
|
|
1421
|
+
|
|
1422
|
+
(reagent.ratom.Reaction.cljs$lang$ctorPrWriter = (function (this__5287__auto__,writer__5288__auto__,opt__5289__auto__){
|
|
1423
|
+
return cljs.core._write(writer__5288__auto__,"reagent.ratom/Reaction");
|
|
1424
|
+
}));
|
|
1425
|
+
|
|
1426
|
+
/**
|
|
1427
|
+
* Positional factory function for reagent.ratom/Reaction.
|
|
1428
|
+
*/
|
|
1429
|
+
reagent.ratom.__GT_Reaction = (function reagent$ratom$__GT_Reaction(f,state,dirty_QMARK_,nocache_QMARK_,watching,watches,auto_run,caught){
|
|
1430
|
+
return (new reagent.ratom.Reaction(f,state,dirty_QMARK_,nocache_QMARK_,watching,watches,auto_run,caught));
|
|
1431
|
+
});
|
|
1432
|
+
|
|
1433
|
+
reagent.ratom.flush_BANG_ = (function reagent$ratom$flush_BANG_(){
|
|
1434
|
+
while(true){
|
|
1435
|
+
var q = reagent.ratom.rea_queue;
|
|
1436
|
+
if((q == null)){
|
|
1437
|
+
return null;
|
|
1438
|
+
} else {
|
|
1439
|
+
(reagent.ratom.rea_queue = null);
|
|
1440
|
+
|
|
1441
|
+
var n__5593__auto___12421 = q.length;
|
|
1442
|
+
var i_12422 = (0);
|
|
1443
|
+
while(true){
|
|
1444
|
+
if((i_12422 < n__5593__auto___12421)){
|
|
1445
|
+
var r_12423 = (q[i_12422]);
|
|
1446
|
+
r_12423._queued_run();
|
|
1447
|
+
|
|
1448
|
+
var G__12424 = (i_12422 + (1));
|
|
1449
|
+
i_12422 = G__12424;
|
|
1450
|
+
continue;
|
|
1451
|
+
} else {
|
|
1452
|
+
}
|
|
1453
|
+
break;
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
continue;
|
|
1457
|
+
}
|
|
1458
|
+
break;
|
|
1459
|
+
}
|
|
1460
|
+
});
|
|
1461
|
+
(reagent.impl.batching.ratom_flush = reagent.ratom.flush_BANG_);
|
|
1462
|
+
reagent.ratom.make_reaction = (function reagent$ratom$make_reaction(var_args){
|
|
1463
|
+
var args__5732__auto__ = [];
|
|
1464
|
+
var len__5726__auto___12425 = arguments.length;
|
|
1465
|
+
var i__5727__auto___12426 = (0);
|
|
1466
|
+
while(true){
|
|
1467
|
+
if((i__5727__auto___12426 < len__5726__auto___12425)){
|
|
1468
|
+
args__5732__auto__.push((arguments[i__5727__auto___12426]));
|
|
1469
|
+
|
|
1470
|
+
var G__12427 = (i__5727__auto___12426 + (1));
|
|
1471
|
+
i__5727__auto___12426 = G__12427;
|
|
1472
|
+
continue;
|
|
1473
|
+
} else {
|
|
1474
|
+
}
|
|
1475
|
+
break;
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
var argseq__5733__auto__ = ((((1) < args__5732__auto__.length))?(new cljs.core.IndexedSeq(args__5732__auto__.slice((1)),(0),null)):null);
|
|
1479
|
+
return reagent.ratom.make_reaction.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__5733__auto__);
|
|
1480
|
+
});
|
|
1481
|
+
|
|
1482
|
+
(reagent.ratom.make_reaction.cljs$core$IFn$_invoke$arity$variadic = (function (f,p__12303){
|
|
1483
|
+
var map__12305 = p__12303;
|
|
1484
|
+
var map__12305__$1 = cljs.core.__destructure_map(map__12305);
|
|
1485
|
+
var auto_run = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__12305__$1,new cljs.core.Keyword(null,"auto-run","auto-run",1958400437));
|
|
1486
|
+
var on_set = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__12305__$1,new cljs.core.Keyword(null,"on-set","on-set",-140953470));
|
|
1487
|
+
var on_dispose = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__12305__$1,new cljs.core.Keyword(null,"on-dispose","on-dispose",2105306360));
|
|
1488
|
+
var reaction = reagent.ratom.__GT_Reaction(f,null,true,false,null,null,null,null);
|
|
1489
|
+
reaction._set_opts(new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"auto-run","auto-run",1958400437),auto_run,new cljs.core.Keyword(null,"on-set","on-set",-140953470),on_set,new cljs.core.Keyword(null,"on-dispose","on-dispose",2105306360),on_dispose], null));
|
|
1490
|
+
|
|
1491
|
+
return reaction;
|
|
1492
|
+
}));
|
|
1493
|
+
|
|
1494
|
+
(reagent.ratom.make_reaction.cljs$lang$maxFixedArity = (1));
|
|
1495
|
+
|
|
1496
|
+
/** @this {Function} */
|
|
1497
|
+
(reagent.ratom.make_reaction.cljs$lang$applyTo = (function (seq12299){
|
|
1498
|
+
var G__12300 = cljs.core.first(seq12299);
|
|
1499
|
+
var seq12299__$1 = cljs.core.next(seq12299);
|
|
1500
|
+
var self__5711__auto__ = this;
|
|
1501
|
+
return self__5711__auto__.cljs$core$IFn$_invoke$arity$variadic(G__12300,seq12299__$1);
|
|
1502
|
+
}));
|
|
1503
|
+
|
|
1504
|
+
reagent.ratom.temp_reaction = reagent.ratom.make_reaction(null);
|
|
1505
|
+
/**
|
|
1506
|
+
* Evaluates `f` and returns the result. If `f` calls `deref` on any ratoms,
|
|
1507
|
+
* creates a new Reaction that watches those atoms and calls `run` whenever
|
|
1508
|
+
* any of those watched ratoms change. Also, the new reaction is added to
|
|
1509
|
+
* list of 'watches' of each of the ratoms. The `run` parameter is a function
|
|
1510
|
+
* that should expect one argument. It is passed `obj` when run. The `opts`
|
|
1511
|
+
* are any options accepted by a Reaction and will be set on the newly created
|
|
1512
|
+
* Reaction. Sets the newly created Reaction to the `key` on `obj`.
|
|
1513
|
+
*/
|
|
1514
|
+
reagent.ratom.run_in_reaction = (function reagent$ratom$run_in_reaction(f,obj,key,run,opts){
|
|
1515
|
+
var r = reagent.ratom.temp_reaction;
|
|
1516
|
+
var res = reagent.ratom.deref_capture(f,r);
|
|
1517
|
+
if((r.watching == null)){
|
|
1518
|
+
} else {
|
|
1519
|
+
(reagent.ratom.temp_reaction = reagent.ratom.make_reaction(null));
|
|
1520
|
+
|
|
1521
|
+
r._set_opts(opts);
|
|
1522
|
+
|
|
1523
|
+
(r.f = f);
|
|
1524
|
+
|
|
1525
|
+
(r.auto_run = (function (){
|
|
1526
|
+
return (run.cljs$core$IFn$_invoke$arity$1 ? run.cljs$core$IFn$_invoke$arity$1(obj) : run.call(null,obj));
|
|
1527
|
+
}));
|
|
1528
|
+
|
|
1529
|
+
reagent.ratom.goog$module$goog$object.set(obj,key,r);
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
return res;
|
|
1533
|
+
});
|
|
1534
|
+
reagent.ratom.check_derefs = (function reagent$ratom$check_derefs(f){
|
|
1535
|
+
var ctx = ({});
|
|
1536
|
+
var res = reagent.ratom.in_context(ctx,f);
|
|
1537
|
+
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [res,(!((ctx.captured == null)))], null);
|
|
1538
|
+
});
|
|
1539
|
+
|
|
1540
|
+
/**
|
|
1541
|
+
* @constructor
|
|
1542
|
+
* @implements {cljs.core.IWatchable}
|
|
1543
|
+
* @implements {cljs.core.IAtom}
|
|
1544
|
+
* @implements {cljs.core.IEquiv}
|
|
1545
|
+
* @implements {cljs.core.IReset}
|
|
1546
|
+
* @implements {cljs.core.ISwap}
|
|
1547
|
+
* @implements {cljs.core.IDeref}
|
|
1548
|
+
* @implements {cljs.core.IPrintWithWriter}
|
|
1549
|
+
*/
|
|
1550
|
+
reagent.ratom.Wrapper = (function (state,callback,changed,watches){
|
|
1551
|
+
this.state = state;
|
|
1552
|
+
this.callback = callback;
|
|
1553
|
+
this.changed = changed;
|
|
1554
|
+
this.watches = watches;
|
|
1555
|
+
this.cljs$lang$protocol_mask$partition1$ = 114690;
|
|
1556
|
+
this.cljs$lang$protocol_mask$partition0$ = 2149613568;
|
|
1557
|
+
});
|
|
1558
|
+
(reagent.ratom.Wrapper.prototype.cljs$core$IDeref$_deref$arity$1 = (function (this$){
|
|
1559
|
+
var self__ = this;
|
|
1560
|
+
var this$__$1 = this;
|
|
1561
|
+
if(((self__.changed) && ((!((reagent.ratom._STAR_ratom_context_STAR_ == null)))))){
|
|
1562
|
+
if(reagent.debug.has_console){
|
|
1563
|
+
((reagent.debug.tracking)?reagent.debug.track_console:console).warn(["Warning: ","derefing stale wrap: ",cljs.core.pr_str.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([this$__$1], 0))].join(''));
|
|
1564
|
+
} else {
|
|
1565
|
+
}
|
|
1566
|
+
} else {
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1569
|
+
|
|
1570
|
+
return self__.state;
|
|
1571
|
+
}));
|
|
1572
|
+
|
|
1573
|
+
(reagent.ratom.Wrapper.prototype.cljs$core$IReset$_reset_BANG_$arity$2 = (function (this$,newval){
|
|
1574
|
+
var self__ = this;
|
|
1575
|
+
var this$__$1 = this;
|
|
1576
|
+
var oldval = self__.state;
|
|
1577
|
+
(self__.changed = true);
|
|
1578
|
+
|
|
1579
|
+
(self__.state = newval);
|
|
1580
|
+
|
|
1581
|
+
if((!((self__.watches == null)))){
|
|
1582
|
+
reagent.ratom.notify_w(this$__$1,oldval,newval);
|
|
1583
|
+
} else {
|
|
1584
|
+
}
|
|
1585
|
+
|
|
1586
|
+
(self__.callback.cljs$core$IFn$_invoke$arity$1 ? self__.callback.cljs$core$IFn$_invoke$arity$1(newval) : self__.callback.call(null,newval));
|
|
1587
|
+
|
|
1588
|
+
return newval;
|
|
1589
|
+
}));
|
|
1590
|
+
|
|
1591
|
+
(reagent.ratom.Wrapper.prototype.cljs$core$ISwap$_swap_BANG_$arity$2 = (function (a,f){
|
|
1592
|
+
var self__ = this;
|
|
1593
|
+
var a__$1 = this;
|
|
1594
|
+
return a__$1.cljs$core$IReset$_reset_BANG_$arity$2(null,(f.cljs$core$IFn$_invoke$arity$1 ? f.cljs$core$IFn$_invoke$arity$1(self__.state) : f.call(null,self__.state)));
|
|
1595
|
+
}));
|
|
1596
|
+
|
|
1597
|
+
(reagent.ratom.Wrapper.prototype.cljs$core$ISwap$_swap_BANG_$arity$3 = (function (a,f,x){
|
|
1598
|
+
var self__ = this;
|
|
1599
|
+
var a__$1 = this;
|
|
1600
|
+
return a__$1.cljs$core$IReset$_reset_BANG_$arity$2(null,(f.cljs$core$IFn$_invoke$arity$2 ? f.cljs$core$IFn$_invoke$arity$2(self__.state,x) : f.call(null,self__.state,x)));
|
|
1601
|
+
}));
|
|
1602
|
+
|
|
1603
|
+
(reagent.ratom.Wrapper.prototype.cljs$core$ISwap$_swap_BANG_$arity$4 = (function (a,f,x,y){
|
|
1604
|
+
var self__ = this;
|
|
1605
|
+
var a__$1 = this;
|
|
1606
|
+
return a__$1.cljs$core$IReset$_reset_BANG_$arity$2(null,(f.cljs$core$IFn$_invoke$arity$3 ? f.cljs$core$IFn$_invoke$arity$3(self__.state,x,y) : f.call(null,self__.state,x,y)));
|
|
1607
|
+
}));
|
|
1608
|
+
|
|
1609
|
+
(reagent.ratom.Wrapper.prototype.cljs$core$ISwap$_swap_BANG_$arity$5 = (function (a,f,x,y,more){
|
|
1610
|
+
var self__ = this;
|
|
1611
|
+
var a__$1 = this;
|
|
1612
|
+
return a__$1.cljs$core$IReset$_reset_BANG_$arity$2(null,cljs.core.apply.cljs$core$IFn$_invoke$arity$5(f,self__.state,x,y,more));
|
|
1613
|
+
}));
|
|
1614
|
+
|
|
1615
|
+
(reagent.ratom.Wrapper.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this$,other){
|
|
1616
|
+
var self__ = this;
|
|
1617
|
+
var this$__$1 = this;
|
|
1618
|
+
return (((other instanceof reagent.ratom.Wrapper)) && ((((!(self__.changed))) && (((cljs.core.not(other.changed)) && (((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(self__.state,other.state)) && (cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(self__.callback,other.callback)))))))));
|
|
1619
|
+
}));
|
|
1620
|
+
|
|
1621
|
+
(reagent.ratom.Wrapper.prototype.cljs$core$IWatchable$_notify_watches$arity$3 = (function (this$,old,new$){
|
|
1622
|
+
var self__ = this;
|
|
1623
|
+
var this$__$1 = this;
|
|
1624
|
+
return reagent.ratom.notify_w(this$__$1,old,new$);
|
|
1625
|
+
}));
|
|
1626
|
+
|
|
1627
|
+
(reagent.ratom.Wrapper.prototype.cljs$core$IWatchable$_add_watch$arity$3 = (function (this$,key,f){
|
|
1628
|
+
var self__ = this;
|
|
1629
|
+
var this$__$1 = this;
|
|
1630
|
+
return reagent.ratom.add_w(this$__$1,key,f);
|
|
1631
|
+
}));
|
|
1632
|
+
|
|
1633
|
+
(reagent.ratom.Wrapper.prototype.cljs$core$IWatchable$_remove_watch$arity$2 = (function (this$,key){
|
|
1634
|
+
var self__ = this;
|
|
1635
|
+
var this$__$1 = this;
|
|
1636
|
+
return reagent.ratom.remove_w(this$__$1,key);
|
|
1637
|
+
}));
|
|
1638
|
+
|
|
1639
|
+
(reagent.ratom.Wrapper.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (a,w,opts){
|
|
1640
|
+
var self__ = this;
|
|
1641
|
+
var a__$1 = this;
|
|
1642
|
+
return reagent.ratom.pr_atom(a__$1,w,opts,"Wrapper",new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"val","val",128701612),a__$1.cljs$core$IDeref$_deref$arity$1(null)], null));
|
|
1643
|
+
}));
|
|
1644
|
+
|
|
1645
|
+
(reagent.ratom.Wrapper.getBasis = (function (){
|
|
1646
|
+
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.with_meta(new cljs.core.Symbol(null,"state","state",-348086572,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null)),new cljs.core.Symbol(null,"callback","callback",935395299,null),cljs.core.with_meta(new cljs.core.Symbol(null,"changed","changed",-2083710852,null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"tag","tag",-1290361223),new cljs.core.Symbol(null,"boolean","boolean",-278886877,null),new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null)),cljs.core.with_meta(new cljs.core.Symbol(null,"watches","watches",1367433992,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null))], null);
|
|
1647
|
+
}));
|
|
1648
|
+
|
|
1649
|
+
(reagent.ratom.Wrapper.cljs$lang$type = true);
|
|
1650
|
+
|
|
1651
|
+
(reagent.ratom.Wrapper.cljs$lang$ctorStr = "reagent.ratom/Wrapper");
|
|
1652
|
+
|
|
1653
|
+
(reagent.ratom.Wrapper.cljs$lang$ctorPrWriter = (function (this__5287__auto__,writer__5288__auto__,opt__5289__auto__){
|
|
1654
|
+
return cljs.core._write(writer__5288__auto__,"reagent.ratom/Wrapper");
|
|
1655
|
+
}));
|
|
1656
|
+
|
|
1657
|
+
/**
|
|
1658
|
+
* Positional factory function for reagent.ratom/Wrapper.
|
|
1659
|
+
*/
|
|
1660
|
+
reagent.ratom.__GT_Wrapper = (function reagent$ratom$__GT_Wrapper(state,callback,changed,watches){
|
|
1661
|
+
return (new reagent.ratom.Wrapper(state,callback,changed,watches));
|
|
1662
|
+
});
|
|
1663
|
+
|
|
1664
|
+
reagent.ratom.make_wrapper = (function reagent$ratom$make_wrapper(value,callback_fn,args){
|
|
1665
|
+
return reagent.ratom.__GT_Wrapper(value,reagent.impl.util.make_partial_fn(callback_fn,args),false,null);
|
|
1666
|
+
});
|
|
1667
|
+
|
|
1668
|
+
//# sourceMappingURL=reagent.ratom.js.map
|