我想使用Polymer及其Web组件。
我已经使用React + Redux制作了一些应用程序,我非常喜欢Redux用来处理状态和操作的方法。
我的问题是:
react-redux
一样)?答案 0 :(得分:3)
是的,有一个polymer-redux元素允许您将商店注入各种Polymer元素,并提供将数据切片从商店绑定到聚合物属性的机制。
我在我的一个应用程序中使用它,它工作得很好。我总结了我的经验here
答案 1 :(得分:1)
我可以建议我的图书馆redux-store-element。它是一个自定义元素,提供对Redux API的访问。只需将redux-store
元素弹出到需要它的任何组件中。例如,这里是元素的整个API:
<redux-store root-reducer="[[rootReducer]]"></redux-store>
<redux-store action="[[action]]"></redux-store>
<redux-store on-statechange="mapStateToThis"></redux-store>