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
20082026
-
…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 -
…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…
comment by acemarke · 2024-02-27 · in React Labs: What We've Been Working On – February 2024 -
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) -
…://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 -
…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
comment by ng12 · 2019-10-14 · in I created the same app with React and Redux -
…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? -
▲ 1
Redux ducks patternstory by ducaale · 2018-10-03 · 0 comments
-
…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...
comment by bgschiller · 2018-07-10 · in Lay Out Your Code Like You'd Lay Out Your House -
…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
comment by ng12 · 2017-11-10 · in How we do Vue at GitLab: one year later -
…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 -
…loaded into other applications and environments. I think this is the first time I saw the approach: https://github.com/erikras/ducks-modular-redux
comment by lhnz · 2017-07-05 · in A set of best practices for JavaScript projects -
…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 -
…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 -
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 -
▲ 1
Ducks Proposal: Redux Action and Reducer Bundlesstory by nfriedly · 2017-04-07 · 0 comments
-
▲ 1
Ducks: Redux Reducer Bundlesstory by dsego · 2017-02-09 · 0 comments
-
…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...
comment by roughcoder · 2016-09-07 · in Show HN: Build your first real world React.js application -
…using ducks[1] instead of spreading the reducer/actions everywhere whenever it makes sense. [1] https://github.com/erikras/ducks-modular-redux
comment by Klathmon · 2016-08-27 · in MobX – Simple, scalable state management for React -
▲ 2
Ducks: proposal for bundling reducers, action types and actions when using Reduxstory by antouank · 2016-06-21 · 0 comments
-
…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 -
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