reactive-ruby 0.7.39 → 0.7.40

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0cea406dc7bbeab7ecb30d5ce6656b560fa5e666
4
- data.tar.gz: d9ff3e6794442ed3f443de03e4a2e84f611c4f32
3
+ metadata.gz: e8f32352dc504b51ec1fa36ab7782d4c7dc65ff7
4
+ data.tar.gz: 5a39e1ace085cff51b9b01e16e2d30be7165343a
5
5
  SHA512:
6
- metadata.gz: 41ee7e60bf8c39e39942e8d9976601f7f85ccb24835e3e2b013f94113ad469af2e9e283394f15ec7a558d8c5b3df474bff2dbe80657bb472f2e20ddf27055af3
7
- data.tar.gz: 49a1603e9b00ee55bd9f4c4b4781031250e7c35c24c3485aeefb4063ad65f6198b862f4aed7bf6d0693df37766b2401dff6b05cea866e978102ea85f66fad376
6
+ metadata.gz: 9ba18860c9830a012abae9ebb884039f0f1fe2dbfe880d123c2aa320df7a9eec6f74f87f6e92532937dee22744542b36cffa30f354e289ef5d5ce4e3ddbff0de
7
+ data.tar.gz: 983bb03b491c2e4c5a9af6556d803f6037ded0a76db841ca3d4a309f215dbccc940dd1ef7f9f4184179555b12d84b93c4683bd36a6b94dafa9354709d579d181
@@ -54,7 +54,7 @@ module React
54
54
  def unchanged_processed_params(new_props)
55
55
  Hash[
56
56
  *@processed_params.collect do |key, value|
57
- [key, value] if @props[key] == new_props[key]
57
+ [key, value] if @props[key].equal? new_props[key] # `#{@props[key]} == #{new_props[key]}`
58
58
  end.compact.flatten(1)
59
59
  ]
60
60
  end
@@ -1,3 +1,3 @@
1
1
  module React
2
- VERSION = "0.7.39"
2
+ VERSION = "0.7.40"
3
3
  end
@@ -218,7 +218,8 @@ describe 'the param macro' do
218
218
  expect(React.render_to_static_markup(React.create_element(Foo, foo: {bazwoggle: 1}))).to eq('<span>2</span>')
219
219
  end
220
220
 
221
- it "not after state update" do
221
+ it "even if contains an embedded native object" do
222
+ stub_const "Bar", Class.new(React::Component::Base)
222
223
  stub_const "BazWoggle", Class.new
223
224
  BazWoggle.class_eval do
224
225
  def initialize(kind)
@@ -226,23 +227,28 @@ describe 'the param macro' do
226
227
  end
227
228
  attr_accessor :kind
228
229
  def self._react_param_conversion(json, validate_only)
229
- new(json[:bazwoggle]) if json[:bazwoggle]
230
+ new(JSON.from_object(json[0])[:bazwoggle]) if JSON.from_object(json[0])[:bazwoggle]
230
231
  end
231
- end
232
- Foo.class_eval do
232
+ end
233
+ Bar.class_eval do
233
234
  param :foo, type: BazWoggle
235
+ def render
236
+ params.foo.kind.to_s
237
+ end
238
+ end
239
+ Foo.class_eval do
234
240
  export_state :change_me
235
241
  before_mount do
236
- params.foo.kind = params.foo.kind+1
242
+ Foo.change_me! "initial"
237
243
  end
238
244
  def render
239
- "#{params.foo.kind} - #{Foo.change_me}"
245
+ Bar(foo: Native([`{bazwoggle: #{Foo.change_me}}`]))
240
246
  end
241
247
  end
242
248
  div = `document.createElement("div")`
243
- React.render(React.create_element(Foo, foo: {bazwoggle: 1}), div)
249
+ React.render(React.create_element(Foo, {}), div)
244
250
  Foo.change_me! "updated"
245
- expect(`div.children[0].innerHTML`).to eq("2 - updated")
251
+ expect(`div.children[0].innerHTML`).to eq("updated")
246
252
  end
247
253
  end
248
254
 
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.39
4
+ version: 0.7.40
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Chang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-02 00:00:00.000000000 Z
11
+ date: 2016-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opal