These are chat archives for ractivejs/ractive

26th
Oct 2018
Arnaud Dagnelies
@dagnelies
Oct 26 2018 11:55
Indeed, twoway is only a flag so that ractive does not bind inputs and other form elements. But ractive is also full of tricks ;) For example, you can also use mytest="[[test]]" to just provide the value at initialization without binding.
Cerem Cem ASLAN
@ceremcem
Oct 26 2018 13:54
mytest="[[test]]" trick looks very nice!
kouts
@kouts
Oct 26 2018 13:59
nice yes!
Cerem Cem ASLAN
@ceremcem
Oct 26 2018 14:05
I'm trying to control (get/set) an object's properties via a key/value table in ractive, as if I'm manipulating the values by doing console.log(myobj) and open the Chromium dev tool, right click the console output, "store as global variable", then temp1.color = 'red'
if I assign myobj to a ractive variable, like this.set('foo', myobj), then keys of foo seems missing (because myobj inherits its many properties from another object, so Object.keys(myobj) does not return many keys)
so I created an empty object and assigned myobj properties in a for-in loop:
props = {}
for(prop in myobj){
    props[prop] = myobj[prop]
}
// then set the ractive variable
this.set('foo', props)
Cerem Cem ASLAN
@ceremcem
Oct 26 2018 14:11
this displays the properties correctly (mostly) but when I change a value within the gui, the property doesn't seem to be updated. can anyone point me to the right direction?
...or is it a complex question so I should create an example for this?
Cerem Cem ASLAN
@ceremcem
Oct 26 2018 14:33
...seems like because the values are actually properties (which have getters and setters)
Chris Reeves
@evs-chris
Oct 26 2018 14:34
I want to say you should be able to access prototype properties in ractive, but I haven't messed with that in a while
Arnaud Dagnelies
@dagnelies
Oct 26 2018 14:39
what you want looks looks like the defunct "magic mode"
Cerem Cem ASLAN
@ceremcem
Oct 26 2018 14:52
a simple example can demonstrate the struggle: Playground
sorry, it actually works: Playground
Chris Reeves
@evs-chris
Oct 26 2018 14:57
ah, yes, you can't detach a property from its object, but you can keep the whole object or add wrapper properties to your object that defer to the source
Cerem Cem ASLAN
@ceremcem
Oct 26 2018 14:58
yup, it seems the case
Chris Reeves
@evs-chris
Oct 26 2018 14:59
sorry, the android gitter client is awful
Cerem Cem ASLAN
@ceremcem
Oct 26 2018 14:59
np
Cerem Cem ASLAN
@ceremcem
Oct 26 2018 20:26
I'm currently creating a vector drawing app as you may already know. I had some issues with Paper.js and Iooked around a bit. Then I noticed there is two.js. while taking a look at the examples, I found an addictive game :) https://luniland.halabe.com/
it reminds me the rocket landing: https://www.youtube.com/watch?v=RPGUQySBikQ
Cerem Cem ASLAN
@ceremcem
Oct 26 2018 20:31
so I changed it a bit :D https://luniland.surge.sh/ [1] [2] Happy landings! :D
Chris Reeves
@evs-chris
Oct 26 2018 20:52
I played something very similar back in the Windows 3.1 days 😁
Cerem Cem ASLAN
@ceremcem
Oct 26 2018 20:52
:D
the game also reminds me the good old days, maybe that's why I loved it that much: https://www.youtube.com/watch?v=Dt6Qy0mjEZw
the passenger is my uncle :)
Chris Reeves
@evs-chris
Oct 26 2018 21:00
something I want to try some day
just have to get over my mind terror at free falling 😂
Cerem Cem ASLAN
@ceremcem
Oct 26 2018 21:02
I've some plans to come to US, maybe we have a chance to do so :P