Comments (11)
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 forwardTo
.
from prism.
you could also use https://github.com/acdlite/recompose/blob/master/docs/API.md#onlyupdateforkeys and just not include dispatcher.
from prism.
Thanks, @namjul !
I didn't check their API in enough detail. Would onlyUpdateForKeys()
also ensure that call to dispatch
from wrapped component will be properly delegated to latest instance, despite wrapped component not being rendered with it? Also general behavior for redux-elm
views would be to update for all keys except dispatch
but that can probably be achieved by some function from recompose api.
But, final question still remains. Since redux-elm
is opinionated with usage of dispatch (it comes with forwardTo
) and immutability of model, shouldn't this be also included out of box?
from prism.
Great! Looking forward to see that implementation.
I must confess I tried that approach, but all I came up with was pretty cumbersome to use in components like gif-viewers-pair
and gif-viewers-dynamic-list
. Hope it will not be that way. :)
from prism.
@minedeljkovic i think it will just use the instance of dispatch it got initially.
from prism.
Thanks, @namjul . That would not be good for this case.
from prism.
so in your case your forwardTo function isn't static and it can change based on some logic.
from prism.
Yes, I think that is generally the case in redux-elm
. Take for example gif-viewers-dynamic-list
. Components in dynamic list could be reordered so their dispatch path would change.
from prism.
oh right .. missed that one :)
from prism.
@minedeljkovic FYI actually "onlyUpdateForKeys" should also return the latest dispatch function. So whenever shouldUpdate returns true, the current dispatch function is used.
https://github.com/acdlite/recompose/blob/master/src/packages/recompose/onlyUpdateForKeys.js
from prism.
Solved in #14
from prism.
Related Issues (20)
- Don't Call PropTypes HOT 3
- Sibling components interaction best practice HOT 6
- Performance HOT 2
- Request to join cdnjs HOT 1
- Build a umd package for Browser usage
- Reduce bundle size by using rxjs modularity HOT 1
- Mount order and saga registering HOT 8
- Get currentUser state in component Updater HOT 3
- Sagas not getting unmounted HOT 2
- Version 4.x.x HOT 7
- redux-saga update HOT 2
- Documentation links 404 HOT 5
- Where is documentation for v3? HOT 2
- Props 'selector' and 'wrapper' get passed down to enhanced component HOT 3
- prism-redux/escapeRegexp.js is missing a character in the regex
- Questions about using side-effect libraries with prism
- How to wrap/unwrap dynamic components? HOT 2
- Provide a wrapper compatible with the library-provided unwrapper
- EnhanceComponent doesn't work with thunk middleware
- Dynamic list of stateful components HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prism.