How to use polymer-redux with polymer-build?

夙愿已清 提交于 2019-12-12 09:07:28

问题


I've currently started a new project based on Polymer Custom Build. I've modified the project in order to add usage of polymer-redux. Since then, when trying to build a bundled project using the command gulp build, I have the following problem

[unknown-polymer-behavior] - Unable to resolve behavior ReduxBehavior. Did you import it? Is it annotated with @polymerBehavior?

Declaring the ReduxBehavior is done using ReduxBehavior = PolymerRedux(store); which is not very usual.

Anybody succeeded to make both of polymer-build and polymer-redux work together ?


回答1:


You can check the sample repo for Polymer 2 with Redux Application.

https://github.com/kumarargutech/polymer-redux

I hope it's helpful to you!




回答2:


You can check out this Polycast edition.

Here is the code

You can also check the Simpla repo

Basically you create a polymer-redux-store-html:

<html>
    <head>
        <link rel="import" href="../bower_components/polymer-redux/polymer-redux.html">
        <script>
            var ReduxBehavior = new PolymerRedux(THG.store);
        </script>
    </head>
    <body>
    </body>
</html>

and include it in any element where you need the ReduxBehavior



来源:https://stackoverflow.com/questions/42044277/how-to-use-polymer-redux-with-polymer-build

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!