Imagine the following scenario:
const state = {
counters: {
count1: 1,
count2: 2,
count3: 3
}
};
const actions = {
counters: {
inc1: () => ({ count1 }) => ({ count1: count1 + 1 })
}
};
Let's run inc1() action and here's what we see...
prev state:
{
count1: 1,
count2: 2,
count3: 3
}
next state:
What's expected next state:
{
count1: 2,
count2: 2,
count3: 3
}
Right now logger simply returns the result of an action, and I strongly believe that it should return merged slice of a state.
Here's an illustration
BTW, thanks for logger!
Imagine the following scenario:
Let's run
inc1()action and here's what we see...prev state:
next state:
What's expected next state:
Right now logger simply returns the result of an action, and I strongly believe that it should return merged slice of a state.
Here's an illustration
BTW, thanks for logger!