Skip to content
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

When a polymer 3 element ? #135

Open
alexandru-tomescu opened this issue Aug 24, 2018 · 7 comments
Open

When a polymer 3 element ? #135

alexandru-tomescu opened this issue Aug 24, 2018 · 7 comments

Comments

@alexandru-tomescu
Copy link

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

Thank you !

@punkratz312
Copy link

+1 polymer 3 support plz

@tur-nr
Copy link
Owner

tur-nr commented Oct 17, 2018

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
Copy link
Owner

tur-nr commented Oct 21, 2018

PR #137

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

npm install --save polymer-redux@next

@RoXuS
Copy link

RoXuS commented Oct 26, 2018

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 ?

@alexandru-tomescu
Copy link
Author

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

@RoXuS
Copy link

RoXuS commented Nov 6, 2018

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

@tur-nr
Copy link
Owner

tur-nr commented Nov 6, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants