-
Notifications
You must be signed in to change notification settings - Fork 24
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
[Performance] Pure view (shallow render) #11
Comments
you could also use https://github.com/acdlite/recompose/blob/master/docs/API.md#onlyupdateforkeys and just not include dispatcher. |
Thanks, @namjul ! But, final question still remains. Since |
Thanks @minedeljkovic and @namjul I'd agree that this should definitely be part of the framework. IMO tagged dispatch should be memoized, so I'd just change implementation of |
Great! Looking forward to see that implementation. |
@minedeljkovic i think it will just use the instance of dispatch it got initially. |
Thanks, @namjul . That would not be good for this case. |
so in your case your forwardTo function isn't static and it can change based on some logic. |
Yes, I think that is generally the case in |
oh right .. missed that one :) |
@minedeljkovic FYI actually "onlyUpdateForKeys" should also return the latest dispatch function. So whenever shouldUpdate returns true, the current dispatch function is used. |
Solved in #14 |
In gif-viewers-pair example, it should be possible to make
random-gif-viewer
component pure, so it should rerender only when its model change. For example, when 'Request more' is clicked on 'funny cats' topic and new gif is received, component for 'funny dogs' topic should not be rerendered.This should be easily achievable with something like recompose pure helper.
But, the problem is that
forwardTo
calls propagate new instances ofdispatch
down the component hierarchy.I made proof of concept implementation of gif-viewers-pair example that tries to solve this problem.
Here is higher order component views should use: higher order component that enables shallow render
Here is example of usage.
Do you think solution to this problem (similar to the one I gave in this quick implementation, or something different) should be also part of
redux-elm
architecture?The text was updated successfully, but these errors were encountered: