polymer-redux icon indicating copy to clipboard operation
polymer-redux copied to clipboard

When a polymer 3 element ?

Open alexandru-tomescu opened this issue 6 years ago • 7 comments

HI ! Congrats for this library. I want to ask you when this will be avaialble for polymer 3 ?

Thank you !

alexandru-tomescu avatar Aug 24 '18 12:08 alexandru-tomescu

+1 polymer 3 support plz

punkratz312 avatar Oct 17 '18 12:10 punkratz312

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 🙏

tur-nr avatar Oct 17 '18 13:10 tur-nr

PR #137

Checkout https://github.com/tur-nr/polymer-redux/tree/dev/v2.x for the new API.

npm install --save polymer-redux@next

tur-nr avatar Oct 21 '18 07:10 tur-nr

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 avatar Oct 26 '18 15:10 RoXuS

@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 avatar Nov 06 '18 09:11 alexandru-tomescu

@alexandru-tomescu, it seems to be the same think with mapStateToProps from the new 2.x API, no ?

RoXuS avatar Nov 06 '18 16:11 RoXuS

@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.

tur-nr avatar Nov 06 '18 22:11 tur-nr