-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dereferencing to automatically trigger an update... like Reagent #16
Comments
I think this contradicts a little bit to core idea of freactive. Because, as far as I understand, freactive tries to deliver changes to exact place (dom node, attributes or styles), not to entire component. |
Yeah, so as Ruslan was just explaining the model for freactive is a bit different. A component in freactive is basically created by passing something that is "derefable" (implements So, it is a slightly different model. After talking with several people at Clojure/conj about this, I realize that the way this model works may need a bit more explaining than I've given it so I definitely intend to write some more detailed docs about this. For those coming from the React/Reagent/Om model, I think what I'm doing may seem a little strange at first, but I'm pretty sure that once one "groks" it, it will make sense... What it allows one to do is direct binding which is inherently more efficient than diffing for most cases (I do have experimental diffing to support other cases if that should be needed). So the Regeant syntax for component instantiation - although it is less typing - may not be more clear. In my mind, it adds a degree of "complection" (using Rich Hickey's terminology) which just isn't necessary once we have our own component (binding) model not tied to React. Let me know if this explanation makes sense. I'm trying to figure out the best way to communicate this model. |
Is this why add-watch doesn't seem to work with an rx expression? See https://gist.github.com/sparkofreason/a42420c3f9572de5c82d I never see output for the :c*d watch. |
|
I tried with both 0.1.0 and 0.2.0-SNAPSHOT, same result. Agreed on using |
If you try dereferencing the c*d before you add the watch does that help?
|
Oops, I looked at your example again and see that you're doing that. Just On Tue, Apr 21, 2015 at 11:58 AM, Aaron Craelius [email protected]
|
Actually, it works if I deref it twice before adding the watch. |
Looks like this is a good case for me to debug before the next release.
There is a concept of laziness in the current implementation, but I think
that often ends up in things being too lazy. The atom/cursor infrastructure
will probably go through some pretty thorough refactoring before I call it
stable. FYI freactive should work with other atom/rx implementations such
as javelin which may be more stable right now.
|
Thanks, will look into other implementations if I need them. Not sure I will, as long as DOM updates work correctly. I'm experimenting using freactive to build HTML custom elements in ClojureScript (https://github.com/allgress/cereus). Looks pretty solid so far (albeit with very limited testing), and a vast improvement over my previous attempt using React-like virtual DOM. |
Nice :) On Wed, Apr 22, 2015 at 11:54 AM, Dave Dixon [email protected]
|
It's possible that issue 44 would solve this issue... #44 (rallying support) |
|
Reagent's |
First of all, this is amazing stuff.
The notion of having a pure cljs 'react' is very exciting.
Being able to use any tag is very convenient.
I was wondering if it was possible to somehow do the same thing as reagent:
No need for
rx
, the simple act of deferencing capture everything that's needed.The text was updated successfully, but these errors were encountered: