From 3e681153c2cec42d78a8bc87c34561f11f0158fa Mon Sep 17 00:00:00 2001
From: jwikmark <jacob@wikmark.se>
Date: Tue, 13 Mar 2018 14:10:49 +0100
Subject: [PATCH] obs => observe

---
 src/construct.jl |  2 +-
 src/gui.jl       | 14 +++++++-------
 src/tools.jl     |  2 +-
 test/runtests.jl |  6 +++---
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/construct.jl b/src/construct.jl
index d3dadcf..b57dd0b 100644
--- a/src/construct.jl
+++ b/src/construct.jl
@@ -17,7 +17,7 @@ end
 function map_block(block, symbols)
     lambda = Expr(:(->), Expr(:tuple, symbols...),
                   block)
-    :(map($lambda, $(map(s->:(obs($s)), symbols)...)))
+    :(map($lambda, $(map(s->:(observe($s)), symbols)...)))
 end
 
 function symbols(bindings)
diff --git a/src/gui.jl b/src/gui.jl
index e0e2acb..79a4815 100644
--- a/src/gui.jl
+++ b/src/gui.jl
@@ -80,7 +80,7 @@ Used to set the widgets, the dom or the data array of the GUI. This replaces any
 """
 function set!(gui::GUI, widgets::Widget_Container)
     gui.widgets = widgets
-    gui.values = [obs(widget).val for widget in gui.widgets.widgets]
+    gui.values = [observe(widget).val for widget in gui.widgets.widgets]
 end
 
 function set!(gui::GUI, dom::WebIO.Node)
@@ -109,11 +109,11 @@ function Base.push!(gui::GUI, values::Tuple, indices::Tuple)
 end
 
 function Base.getindex(gui::GUI, s::Symbol)
-    obs(gui.widgets[s])[]
+    observe(gui.widgets[s])[]
 end
 
 function Base.setindex!(gui::GUI, newval, s::Symbol)
-    obs(gui.widgets[s])[] = newval
+    observe(gui.widgets[s])[] = newval
 end
 
 """
@@ -126,7 +126,7 @@ function add!(gui::GUI, widgets::Widget_Container)
     end
     gui.widgets.widgets = vcat(gui.widgets.widgets, widgets.widgets)
     gui.widgets.vals = merge(gui.widgets.vals, newdict)
-    gui.values = vcat(gui.values, [obs(w)[] for w in widgets.widgets])
+    gui.values = vcat(gui.values, [observe(w)[] for w in widgets.widgets])
 end
 
 
@@ -196,14 +196,14 @@ function update(gui::GUI, s::Symbol, watchsymbol=:0)
     # if the value of the widget associated with watchsymbol has changed
     w = gui.widgets[s]
     if watchsymbol==:0||has_changed(gui, watchsymbol)
-        #obs(w).listeners[2](obs(w)[])
-        obs(w)[] = obs(w)[]
+        #observe(w).listeners[2](observe(w)[])
+        observe(w)[] = observe(w)[]
     end
 end
 function update(gui::GUI, a::Array, watchsymbol=:0)
     W = [gui.widgets[s] for s in a]
     if watchsymbol==:0||has_changed(gui, watchsymbol)
-        [obs(w).listeners[2](obs(w)[]) for w in W]
+        [observe(w).listeners[2](observe(w)[]) for w in W]
     end
 end
 
diff --git a/src/tools.jl b/src/tools.jl
index 4769768..da8d1d5 100644
--- a/src/tools.jl
+++ b/src/tools.jl
@@ -4,7 +4,7 @@ Links the values of two observables by adding a listener. Optional arguments f a
 
 Example:
 link(o1, o2, (x) -> 2*x, (x) -> x/2)
-will ensure obs(o2)[] is always 2*obs(o1)[] and vice versa.
+will ensure observe(o2)[] is always 2*observe(o1)[] and vice versa.
 
 """
 function link!(o1::Observable, o2::Observable, f = (x)->(x), g = (x)->(x), master=false)
diff --git a/test/runtests.jl b/test/runtests.jl
index 69a63a1..9bd8a1a 100644
--- a/test/runtests.jl
+++ b/test/runtests.jl
@@ -59,7 +59,7 @@ end
     add!(gui, wid2)
     gui[:dummy] = 23
     @test typeof(gui()) <: WebIO.Node
-    @test obs(dummy)[] == 23
+    @test observe(dummy)[] == 23
     @test gui.widgets[:dummy] == dummy
 end
 
@@ -86,6 +86,6 @@ end
         WebIO.render(dummy)
     end
     @test typeof(ui) <: WebIO.Node{WebIO.DOM}
-    obs(dummy)[] = 80
-    @test obs(dummy)[] == 80
+    observe(dummy)[] = 80
+    @test observe(dummy)[] == 80
 end
-- 
GitLab