Hacker GitHub

← All repos

erikras/ducks-modular-redux

View on GitHub ↗ ★ 9,529 JavaScript

A proposal for bundling reducers, action types and actions when using Redux

22 mentions on Hacker News by 16 people: 4 stories, 18 comments · first 2016-06-12 · latest 2025-11-07

Mentions per year 22 mentions · busiest year 2017 (9)
20082026
  1. …for single-file logic was created by the community just a couple months after Redux was created: - https://github.com/erikras/ducks-modular-redux which is what we later turned into "Redux slices", a single file with a `createSlice` call…
    comment by acemarke · 2025-11-07 · in Dead Framework Theory
  2. …cared about how you organized your code at the runtime level. The single-file "ducks pattern" ( https://github.com/erikras/ducks-modular-redux ) was proposed very early on and was always something users could do. - Labeling "global…
  3. The Reducks pattern https://github.com/erikras/ducks-modular-redux fixes the boilterplate problem by keeping your action types, action creators, and reducers in the same file.
    comment by l1ambda · 2020-04-09 · in Redux – Not Dead Yet (2018)
  4. …://redux-starter-kit.js.org/api/createSlice [2] https://immerjs.github.io/immer/docs/introduction [3] https://github.com/erikras/ducks-modular-redux [4] https://redux-starter-kit.js.org/tutorials/advanced-tutorial
    comment by acemarke · 2019-10-28 · in Reducing Redux Boilerplate in TypeScript
  5. …they aren’t seemingly repeated in 3-4 different locations. This is what the "duck" pattern is for: https://github.com/erikras/ducks-modular-redux
  6. …get rid of switch statements, you can check my comment bellow - about "action-reducer". I've seen https://github.com/erikras/ducks-modular-redux and it's close to what I do. Also you can check - https://github.com/reduxjs/redux/issues/1167#…
    comment by flwralex · 2019-01-05 · in Ask HN: Go-to web stack today?
  7. …Ducks pattern[1] that I've been excited about recently. And also Vue's single-file components. [1] https://github.com/erikras/ducks-modular-redux/blob/master/R...
  8. …API. In my own code I don't even do that, instead exporting a function which operates on the state. https://github.com/erikras/ducks-modular-redux
  9. Here's the links for all those things mentioned if you don't want to have to look them up like I did: https://github.com/erikras/ducks-modular-redux https://github.com/keajs/kea https://redux-tiles.js.org/…
    comment by marcins · 2017-09-26 · in React 16
  10. …s://github.com/reactjs/redux/issues/2295 [0] https://github.com/markerikson/redux-ecosystem-links [1] https://github.com/erikras/ducks-modular-redux [2] https://github.com/markerikson/redux-ecosystem-links/blob/ma... [3]…
    comment by acemarke · 2017-07-07 · in Idiomatic Redux: Implementation and Intent
  11. …loaded into other applications and environments. I think this is the first time I saw the approach: https://github.com/erikras/ducks-modular-redux
  12. …for a given portion of the application into one file. This is known as the "ducks" structure, per https://github.com/erikras/ducks-modular-redux . - Use a utility library like https://github.com/acdlite/redux-actions to generate action…
    comment by acemarke · 2017-05-09 · in Build Yourself a Redux
  13. …by instantly pointing out typos. There are also patterns to reduce the import issue. For example, https://github.com/erikras/ducks-modular-redux . I prefer defining my actions with my action creators in one big index, but the point is that…
    comment by joshwcomeau · 2017-05-05 · in Build Yourself a Redux
  14. There's a critical mass where I switch to using Ducks: https://github.com/erikras/ducks-modular-redux Yes, you can write bad Redux code. That doesn't mean it's not simple.
    comment by ng12 · 2017-05-05 · in Build Yourself a Redux
  15. …and again easy to test. [1] https://gist.github.com/anonymous/a20f603f9922742bd3cea7a08c... [2] https://github.com/erikras/ducks-modular-redux [3] https://medium.com/@dan_abramov/smart-and-dumb-components-7c...
  16. …using ducks[1] instead of spreading the reducer/actions everywhere whenever it makes sense. [1] https://github.com/erikras/ducks-modular-redux
  17. …layer of most Redux applications I see. I would suggest that people check out the Ducks pattern: https://github.com/erikras/ducks-modular-redux To sum it up: your constants, action creators, action handlers, and reducer all go in a single…
    comment by iLoch · 2016-06-13 · in A SoundCloud client in React and Redux
  18. Of course: https://github.com/erikras/ducks-modular-redux The potential reason not to do that is that more than a reducer may listen for a given action, even though I guess it's more an exception than the norm.
    comment by tacone · 2016-06-12 · in A SoundCloud client in React and Redux