Hacker News new | ask | show | jobs
by acemarke 2014 days ago
I'm very curious what they mean by "Figma uses Redux, so we have models, actions and reducers". "Models" is not a term that is normally associated with Redux.

Note that we now recommend using the "ducks/slice file" pattern for organizing Redux logic for a given feature in a single file:

https://redux.js.org/style-guide/style-guide#structure-files...

which you basically get for free anyway if you're using our official Redux Toolkit package and the `createSlice` API (which generates action creators based on your reducers):

https://redux.js.org/tutorials/fundamentals/part-8-modern-re...

Obviously the Figma codebase has been around for a while so this isn't an immediate solution to their issue, but it definitely simplifies dealing with most Redux logic.

1 comments

Good question! Looks like I might have slipped an internal term in there inadvertently. It just refers to type definition/interface declaration files for objects that are stored in the Redux store, we just happen to stick most of them in a folder that’s been called “models” for a long time.