Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Alexander Semenov
@Tvaroh
not currently, but it's a good idea to add this feature
Alexander Semenov
@Tvaroh
@andru, just added Binding.addOnceListener as part of 0.7.17.
Andru Vallance
@andru
@Tvaroh awesome!
Dafeng
@dfguo
is anyone at React Europe conf? would love to meet up if you are around.
Alexander Semenov
@Tvaroh
unfortunately, no :)
Dafeng
@dfguo
:)
Dafeng
@dfguo
i spoke with some people at the conf about morearty. Many of them are very excited to learn about it
Alexander Semenov
@Tvaroh
cool :) Unfortunately, we're not too PR'ed
Alexander Semenov
@Tvaroh
it turned out that @r00ger is there
Josh Ponelat
@ponelat
hey guys, Morearty is great stuff... clears my head when thinking about the frontend :smile: Any one here got some advice on form validation with it? About to implement, and wondering if I should keep the validation stuff pure React, or put it in a some 'meta' on the global state
Alexander Semenov
@Tvaroh
Hi, @ponelat. It depends, I think both approaches are okay.
Josh Ponelat
@ponelat
Thanks @Tvaroh, sorry bout the extreme delay in response
I went with meta, but am considering moving the validation into pure react for less worries about what to bind to.
Can anyone show me how to get the root binding or context from a sub binding?
Alexander Semenov
@Tvaroh
@ponelat, there is getMoreartyContext method, if Morearty mixin is ... mixed in.
Josh Ponelat
@ponelat
thx again @Tvaroh, the link is also great for discovering other methods!
Alexander Semenov
@Tvaroh
you're welcome
Josh Ponelat
@ponelat
hi ... I'm trying to find out why my state isn't triggering a re-render... does it make a difference if you use binding.set('some', { vanilla: 'json'}) vs binding.set('some', Immutable.fromJs({ ... })
Alexander Semenov
@Tvaroh

@ponelat, hi.

Vanilla object won't be auto-converted to ImmutableJS map.

Josh Ponelat
@ponelat
@Tvaroh thanks, I'm moving the code around... still not getting the rendering.. But I'll post here if I find anything unusual :)
Alexander Semenov
@Tvaroh
hmm
re-rendering should be triggered for components bound to 'some' and below
Josh Ponelat
@ponelat
It was something silly, I was using .get(parent).update(child, ...)
I changed to .update(parent.child, ...) and it worked :)
Josh Ponelat
@ponelat
but doesn't get retrieve the object associated ? unlike `sub, which is a binding?
Josh Ponelat
@ponelat
another question? how can I add/customize shouldComponentUpdate?
Josh Ponelat
@ponelat
Thanks! Sometimes I swear I've combed the wiki, and then BAM! its there all along :)
Alexander Semenov
@Tvaroh
:)
Thierry Goettelmann
@ByScripts
Hi there. First: Morearty is AWESOME! Now my question: Is there a way to pass props to the root App component ?
Josh Ponelat
@ponelat
I think that is a react question, and (I'm also new so keep that in mind) you can pass it in when you render into the document
not sure if the "bootstrapped" root component will pass along props, but I'm guessing it does?
Alexander Semenov
@Tvaroh
Hi, @ByScripts. Currently, Morearty doesn't forward bootstrapped root component props down to the component being bootstrapped. But you can pass those props directly to the root component before bootstrapping it. Does it solve your issue? If no, what's your use case?
Thierry Goettelmann
@ByScripts
Thanks for you reply. @ponelat No it does not ;) @Tvaroh "But you can pass those props directly to the root component before bootstrapping it" How can I do that ? It is not possible to do Context.bootstrap(<App myProp="..."/>). For the moment, I worked around by setting these props in the Context initialState, but these are static data only used on App initialization, so I would prefer not having them in the context.
Alexander Semenov
@Tvaroh
oh, my bad, you're right
Alexander Semenov
@Tvaroh
@ByScripts, passing props to bootstrapped components is now supported in 0.7.22.
Thierry Goettelmann
@ByScripts
Neat! Thank you for you React-ivity ^^
Alexander Semenov
@Tvaroh
You're welcome. :smile:
Josh Ponelat
@ponelat
hi... I want to use History's popstate to hydrate or flesh out a previously serialized state. Would the best approach be to use the transit-js example, or would a simple toJS(), fromJS() suffice?
Alexander Semenov
@Tvaroh
@ponelat, it would suffice, unless you use sets or ordered maps in your state
Josh Ponelat
@ponelat
@Tvaroh thanks... I found https://github.com/glenjamin/transit-immutable-js and am using it. But I haven't got the the stage where I can see success or not (still working on the History api, blah!)
Alexander Semenov
@Tvaroh
looks like a helpful project though
Josh Ponelat
@ponelat
hi all, wondering if anyone has some tests with morearty and shallow rendering
Alexander Semenov
@Tvaroh
@ponelat, what is shallow rendering? :)
Josh Ponelat
@ponelat
@Tvaroh ok, to test react we need to render it in a DOM. They've introduced an alternative called shallow rendering, which only renders one component deep (so it doesn't call render() on the children). It can do this without a DOM, which makes it easier to manage. Here is the reference https://facebook.github.io/react/docs/test-utils.html#shallow-rendering
I must just figure out context's (which MoreartyJS uses to 'bootstrap')
Alexander Semenov
@Tvaroh
Interesting. Don't know the answer immediately
Chris Malliapi
@malliapi
hi
Alexander Semenov
@Tvaroh
hello
Punita Ojha
@punitaojha
This message was deleted