reactive-ruby 0.7.24 → 0.7.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/reactive-ruby/component.rb +2 -3
- data/lib/reactive-ruby/observable.rb +7 -7
- data/lib/reactive-ruby/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de348153ef3143a695778ae38f71ab3282402a13
|
4
|
+
data.tar.gz: 3113b14b3394988d09b200057c893e1e1effaaf0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a498ef58657f9adba73020225353168ca8ce45e5bfae520c74f0ad0c7daa5d959a38e69e47193925abf8052cc3894c202963cd966cee4c62cf9339cc77d8f4ee
|
7
|
+
data.tar.gz: fd08e5a0b645aec16359f31d760c2a4ef914a7761ca31bee14c784d836dbe67c4f0da9290931f1e8c560b7d62d75c7278c2bfc6aa33eb6e44723536c1e4b540f
|
@@ -401,9 +401,8 @@ module React
|
|
401
401
|
yield name, React::State.get_state(from || self, name), current_state if block and block.arity > 0
|
402
402
|
React::State.set_state(from || self, name, current_state)
|
403
403
|
React::Observable.new(current_state) do |update|
|
404
|
-
|
405
|
-
|
406
|
-
React::State.set_state(from || self, name, current_state)
|
404
|
+
yield name, React::State.get_state(from || self, name), update if block and block.arity > 0
|
405
|
+
React::State.set_state(from || self, name, update)
|
407
406
|
end
|
408
407
|
end
|
409
408
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module React
|
2
|
-
|
2
|
+
|
3
3
|
class Observable
|
4
4
|
|
5
5
|
def initialize(value, on_change = nil, &block)
|
@@ -8,7 +8,7 @@ module React
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def method_missing(method_sym, *args, &block)
|
11
|
-
@value.send(method_sym, *args, &block).tap { |result| @on_change.call
|
11
|
+
@value.send(method_sym, *args, &block).tap { |result| @on_change.call @value }
|
12
12
|
end
|
13
13
|
|
14
14
|
def respond_to?(method, *args)
|
@@ -18,16 +18,16 @@ module React
|
|
18
18
|
@value.respond_to? method, *args
|
19
19
|
end
|
20
20
|
end
|
21
|
-
|
21
|
+
|
22
22
|
def call(new_value)
|
23
23
|
@on_change.call new_value
|
24
24
|
@value = new_value
|
25
25
|
end
|
26
|
-
|
26
|
+
|
27
27
|
def to_proc
|
28
28
|
lambda { |arg = @value| @on_change.call arg }
|
29
29
|
end
|
30
|
-
|
30
|
+
|
31
31
|
end
|
32
|
-
|
33
|
-
end
|
32
|
+
|
33
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reactive-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Chang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal
|