Skip to content

Is statePath deprecated with Polymer 3 Support? #140

@dylangrandmont

Description

@dylangrandmont

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions