These are chat archives for opal/opal

9th
Jan 2017
Mitch VanDuyn
@catmando
Jan 09 2017 03:25
hello does anybody know how (or if its even possible) to use YAML to marshall / unmarshall ruby objects between client and server? I.e. I want to basically do this:
serialized_object = YAML::dump(c)
then send serialized_object to the client and then
YAML::load(serialized_object)
on the other end of the wire? (this assumes that all the classes involved are available on both client and server)
Elia Schito
@elia
Jan 09 2017 09:22
@catmando I did some stuff on nodejs with an npm package some time ago (1year?) but never tried very hard to make it work in the browser, I think I was using yams-js or something like that
Adesakin Osindero
@adesakin
Jan 09 2017 13:10
Hi All. I want to be able to have
em().on(:change) do |e|
 state.lovevalue! e.target.value
end
But on(:change) is only captured by input().on(:change)
Any help please
Elia Schito
@elia
Jan 09 2017 13:14
@adesakin can you add some context about the libraries you're using?
Adesakin Osindero
@adesakin
Jan 09 2017 13:15
i am using it inside hyperloop
I can do this
input(placeholder: "Type in your address",  class: "no_enter", contentEditable: val_edit_mode, value:state.address).on(:change) do |e|
  state.address! e.target.value
end
But with the code below, I don't get any value for on change
em(placeholder: "Type in your address",  class: "no_enter", contentEditable: val_edit_mode, value:state.address).on(:change) do |e|
  state.address! e.target.value
end
Elia Schito
@elia
Jan 09 2017 15:02
@adesakin not a React expert but maybe you're not supposed to get the change event out of an <em> tag… /cc @catmando
Adesakin Osindero
@adesakin
Jan 09 2017 15:03
Ok let me repost in react forum. I thought it was an opal feature - on(:change)
Elia Schito
@elia
Jan 09 2017 15:04
@adesakin try also the hyperloop channel as they'll probably be more aware of both opal and react
Mitch VanDuyn
@catmando
Jan 09 2017 18:53
@elia @adesakin well that is perhaps the downside of ruby... dsl's so nice you can't tell the difference between the language and a random dsl on top of it :-)
Adesakin Osindero
@adesakin
Jan 09 2017 18:54
lol..
I love Ruby
Mitch VanDuyn
@catmando
Jan 09 2017 21:59
Why can't the same promise be chained multiple times?
  x = Promise.new
  x.then { }
  x.then { } # blows up?  Why?
Mitch VanDuyn
@catmando
Jan 09 2017 22:25
I see its fixed in 0.10!
Elia Schito
@elia
Jan 09 2017 23:01
@catmando I think it had to do with some Promise spec, but @meh surely knows better
Mitch VanDuyn
@catmando
Jan 09 2017 23:32
It's all good...