@australis/redux-es
TypeScript icon, indicating that this package has built-in type declarations

4.0.0 • Public • Published

Redux-es

What:
Repackage redux for use in browser es modules

Install:

# yarn add @australis/redux-es

usage:

    # Browser
    <script type="module">
        window.process = {
            env: {
                NODE_ENV: localStorage.getItem("NODE_ENV")
            }
        }
    </script>
    <script type="module" >
        import redux from "/node_modules/@australis/redux-es/dist/index.js";
        import middleware from "./middleware.js";
        import reducer from "./reducer.js"
        const {
        createStore,
        compose,
        applyMiddleware,
        } = redux;
        const { **REDUX_DEVTOOLS_EXTENSION_COMPOSE** } = window;

        const composeEnhancers =
        typeof window === "object" && **REDUX_DEVTOOLS_EXTENSION_COMPOSE**
        ? **REDUX_DEVTOOLS_EXTENSION_COMPOSE**({
        // Specify extension’s options like name, actionsBlacklist, actionsCreators, serialize...
        })
        : compose;

        /**
         * @type {import("redux").Store}
         */
        const store = createStore(
        reducer,
        composeEnhancers(applyMiddleware(middleware)),
        );

        export default store;
    </script>

Readme

Keywords

none

Package Sidebar

Install

npm i @australis/redux-es

Weekly Downloads

1

Version

4.0.0

License

MIT

Unpacked Size

62.7 kB

Total Files

5

Last publish

Collaborators

  • d10221