{"id":28138,"library":"redux-elm-middleware","title":"redux-elm-middleware","description":"Elm middleware for Redux that enables using Elm reducers within a Redux/React app. Version 4.0.0 is stable but appears to be in maintenance mode with no recent updates. It allows embedding Elm business logic in a Redux store, handling state and effects purely via Elm's update function while keeping access to the React/Redux ecosystem. Alternatives: use Elm directly for the whole app or use port-based communication without this middleware.","status":"maintenance","version":"4.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/stoeffel/redux-elm-middleware","tags":["javascript"],"install":[{"cmd":"npm install redux-elm-middleware","lang":"bash","label":"npm"},{"cmd":"yarn add redux-elm-middleware","lang":"bash","label":"yarn"},{"cmd":"pnpm add redux-elm-middleware","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for Redux store integration","package":"redux","optional":false}],"imports":[{"note":"Default export via ES modules.","wrong":"const createElmMiddleware = require('redux-elm-middleware')","symbol":"createElmMiddleware","correct":"import createElmMiddleware from 'redux-elm-middleware'"},{"note":"Named export for the Elm reducer used in combineReducers.","wrong":"const reducer = require('redux-elm-middleware').reducer","symbol":"reducer","correct":"import { reducer } from 'redux-elm-middleware'"},{"note":"The Elm module 'Redux' is part of the source and must be imported via Elm tooling, not via npm import.","wrong":"import Redux from 'redux-elm-middleware'","symbol":"Redux","correct":"import Redux from 'redux-elm-middleware/src/Redux.elm' (or via elm-package.json source-directories)"}],"quickstart":{"code":"import createElmMiddleware from 'redux-elm-middleware';\nimport { reducer as elmReducer } from 'redux-elm-middleware';\nimport { createStore, combineReducers, applyMiddleware, compose } from 'redux';\nimport Elm from '../build/elm';\n\nconst rootReducer = combineReducers({\n  elm: elmReducer,\n  // ... other reducers\n});\n\nconst elmStore = Elm.Reducer.worker();\nconst { run, elmMiddleware } = createElmMiddleware(elmStore);\n\nconst store = createStore(\n  rootReducer,\n  {},\n  compose(\n    applyMiddleware(elmMiddleware),\n    window.devToolsExtension ? window.devToolsExtension() : f => f\n  )\n);\n\nrun(store);","lang":"javascript","description":"Configures Redux store with elm middleware, creates an Elm worker, and runs the middleware to connect Elm's state to Redux."},"warnings":[{"fix":"Ensure your Elm file is a port module and add 'node_modules/redux-elm-middleware/src' to elm-package.json source-directories.","message":"Elm impure ports expected: subscriptions must use port modules and import Redux module from source.","severity":"gotcha","affected_versions":"<=4.0.0"},{"fix":"Consider using Elm ports directly or switching to a more modern integration library like 'elm-redux' or writing custom ports.","message":"No longer actively maintained; last release 2018. May have compatibility issues with newer Elm and Redux versions.","severity":"deprecated","affected_versions":"<=4.0.0"},{"fix":"Invoke run(store) after creating the store as shown in the documentation.","message":"Initialization requires calling run(store) after createStore; missing run will cause store to be undefined.","severity":"breaking","affected_versions":"<=4.0.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Run 'npm install redux-elm-middleware' or 'yarn add redux-elm-middleware'.","cause":"Package not installed or missing from node_modules.","error":"Cannot find module 'redux-elm-middleware'"},{"fix":"Check that your Elm root reducer is named 'Reducer' and compiled to the output file imported as Elm.","cause":"Elm worker name does not match the module name; expected 'Reducer'.","error":"Uncaught Error: Elm worker not found. Make sure the Elm module name matches the worker."},{"fix":"Add 'elm: elmReducer' to combineReducers and ensure actions are dispatched correctly.","cause":"Missing elmReducer in combineReducers or reducer mapping not set up.","error":"Action type '@@elm/...' not recognized by reducers."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}