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

Is statePath deprecated with Polymer 3 Support? #140

Open
dylangrandmont opened this issue Dec 31, 2018 · 0 comments
Open

Is statePath deprecated with Polymer 3 Support? #140

dylangrandmont opened this issue Dec 31, 2018 · 0 comments

Comments

@dylangrandmont
Copy link

Hello,

This is more a question than an issue but I would like to confirm an upgrade step from Polymer 2 to 3 support. I am experimenting with the Polymer 3 branch currently in beta release. https://github.com/tur-nr/polymer-redux/tree/dev/v2.x . My existing components which make use of the statePath API are no longer bound to the redux state. Is the behaviour change below correct and intended? Should this be documented since it is a backwards-incompatible change?

polymer-redux v1.x (does not work with v2.x)

// mySelector is a function using reselect which takes in the redux store as a parameter
import {
  mySelector,
} from ...;

class Component extends ReduxMixin(PolymerElement) {
  static get properties() {
    return {
      mySelectorAsProp: {
        type: Object,
        statePath: mySelector,
      },
    };
  }
}

polymer-redux v2.x

import {
  mySelector,
} from ...;

class Component extends ReduxMixin(PolymerElement) {
  static get properties() {
    return {
    };
  }
  static mapStateToProps(state) {
    return {
      mySelectorAsProp: mySelector(state),
    };
  }
}

Potentially related issue: #126

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

1 participant