
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
polymer-redux
Advanced tools
Polymer bindings for Redux. Bind store state to properties and dispatch actions from within Polymer Elements.
Polymer is a modern library for creating Web Components within an application. Redux is a state container for managing predictable data. Binding the two libraries together allows developers to create powerful and complex applications faster and simpler. This approach allows the components you build with Polymer to be more focused on functionality than the applications state.
bower install --save polymer-redux
// Create a Redux store
const store = Redux.createStore((state = {}, action) => state)
// Create the PolymerRedux mixin
const ReduxMixin = PolymerRedux(store)
// Bind Elements using the mixin
class MyElement extends ReduxMixin(Polymer.Element) {
static get is() {
return 'my-element'
}
connectedCallback() {
super.connectedCallback();
const state = this.getState();
}
}
// Define your Element
customElements.define(MyElement.is, MyElement)
Now MyElement has a connection to the Redux store and can bind properties to
it's state and dispatch actions.
See the documentation page: https://tur-nr.github.io/polymer-redux/docs.
new PolymerRedux(<store>)store Object, Redux store.Returns a ReduxMixin function.
These methods are available on the instance of the component, the element.
#getState()Returns current store's state.
#dispatch(<name>, [args, ...])name String, action name in the actions list.arg... *, Arguments to pass to action function.Returns the action object.
#dispatch(<fn>)fn Function, Redux middleware dispatch function.Returns the action object.
#dispatch(<action>)action Object, the action object.Returns the action object.
state-changedFires when the store's state has changed.
Copyright (c) 2017 Christopher Turner
FAQs
Polymer bindings for Redux.
We found that polymer-redux demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.