Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 44 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -507,22 +507,52 @@ Besides that it would be good if the component would also have it's own, compone
const componentRootReducer = mergeReducers(ComponentSpecificReducer, EditableReducer, FiltersReducer)
```

Some interesting points:
Certainly! Here's a polished and clearer version of the text, with improved structure and tone:

- The final component state would have the shape { data: {}, filtersList: [], editState: false }.
Of course the initial values can be supplied via `createStore` as usual.
- When an action comes in it will be passed throught all reducers from right to left: FiltersReducer then EditableReducer then ComponentSpecificReducer.
- Each reducer will receive the full component state not only it's piece, but it doesn't need to be aware of that is concerned with only updating
it's piece of data( so each one will receive { data: {}, filtersList: [], editState: false } )
- The merged reducers must all return objects so that they can be merged together into a final state.
---

## Key Concepts

* The final component state has the structure:

## TODO (Help wanted)
- Write additional tests
- Verify server side rendering
- Improve and better organize docs, add examples, add a contributing guide
- Development warnings similar to React in dev mode for common mistakes
```js
{
data: {},
filtersList: [],
editState: false
}
```

Initial values can be provided through `createStore` as usual.

* When an action is dispatched, it flows through all reducers **from right to left** in this order:

1. `FiltersReducer`
2. `EditableReducer`
3. `ComponentSpecificReducer`

* Each reducer receives the **entire component state**, not just its slice. However, it only needs to update its own part of the state.
For example, each reducer will get:

```js
{ data: {}, filtersList: [], editState: false }
```

* All reducers must return an **object** representing their updated slice of state. These are then merged to produce the final component state.

---

## 🛠 TODO (Help Wanted)

* Write additional comprehensive tests to cover edge cases and ensure robustness.
* Verify compatibility and correctness of server-side rendering (SSR).
* Improve and better organize the documentation:

* Add practical examples and usage scenarios.
* Create a contributing guide to help new contributors.
* Implement development warnings similar to React's dev mode, alerting developers to common mistakes.

---

Feel free to add anything else I may have missed by opening an issue.
We welcome every contribution!
If you notice anything missing or have ideas for improvement, please open an issue!
We welcome contributions of all kinds and appreciate your help in making this project better.