polymer-redux
polymer-redux copied to clipboard
When a polymer 3 element ?
HI ! Congrats for this library. I want to ask you when this will be avaialble for polymer 3 ?
Thank you !
+1 polymer 3 support plz
Apologies for being way behind on this, I've been really busy and just haven't had time to get a release together.
Polymer 3 Update
- New cleaner and pure API for binding Elements
- Backwards compatible Mixin
- Events can now dispatch actions.
I will try to follow up with an update/pr within the week. Thanks for your patience and support folks 🙏
PR #137
Checkout https://github.com/tur-nr/polymer-redux/tree/dev/v2.x for the new API.
npm install --save polymer-redux@next
Hi @tur-nr, thx for your component, we love it.
We will prepare the update to Polymer 3 and I would like to know the advantages to use polymer-redux with Polymer 3 vs the connect mixin provide by polymer team -> https://github.com/Polymer/pwa-helpers/blob/master/src/connect-mixin.ts ?
@RoXuS i think the only difference is that polymer-redux allows you to sync redux to local values through statePath property, and with connect mixin you have to assign manually when _stateChanged method triggers.
@alexandru-tomescu, it seems to be the same think with mapStateToProps
from the new 2.x API, no ?
@RoXuS both libraries have taken inspiration from https://gist.github.com/kevinpschaaf/995c9d1fd0f58fe021b174c4238b38c3, however, polymer-redux gives a different API to the connected elements.
Both can map state to properties in similar ways. However, when it comes to dispatching actions pwa-helpers requires you to be in scope of the store. Where polymer-redux can dispatch actions via the dispatchAction
method or using static mapDispatchToEvents
method on connected elements.
Read more here about dispatching actions: https://github.com/tur-nr/polymer-redux/tree/dev/v2.x#dispatching-actions
I do like the possibility of lazy loading reducers. This could a future plan for polymer-redux once we have stabilized with testing and feedback.
The real question is; which one do I use in my app, well that depends. If each element has access to the store in order to dispatch actions, then either. If the core element doesn't have access to the store but can dispatch events that can be retargeted as actions to redux, then polymer-redux would be a clear choice.