fix(core): serialize state mutations, fix batch flushing/reentrancy, handle falsy initial values, dispose old StatePart on force, and improve notification/error handling

This commit is contained in:
2026-02-28 08:52:41 +00:00
parent 2f0b39ae41
commit 9312b8908c
8 changed files with 383 additions and 120 deletions

View File

@@ -40,8 +40,10 @@ tap.test('should dispatch a state action', async (tools) => {
const done = tools.defer();
const addFavourite = testStatePart.createAction<string>(async (statePart, payload) => {
const currentState = statePart.getState();
currentState.currentFavorites.push(payload);
return currentState;
return {
...currentState,
currentFavorites: [...currentState.currentFavorites, payload],
};
});
testStatePart
.waitUntilPresent((state) => {