fix(core): update
This commit is contained in:
parent
a4d43456d7
commit
c5a3eb63ad
@ -39,11 +39,11 @@ tap.test('should select something', async () => {
|
||||
tap.test('should dispatch a state action', async () => {
|
||||
const addFavourite = testStatePart.createAction<string>(async (statePart, payload) => {
|
||||
const currentState = statePart.getState();
|
||||
currentState.currentFavorites.push(payload)
|
||||
currentState.currentFavorites.push(payload);
|
||||
return currentState;
|
||||
});
|
||||
await testStatePart.dispatchAction(addFavourite, 'my favourite things')
|
||||
expect(testStatePart.getState().currentFavorites).to.include('my favourite things')
|
||||
await testStatePart.dispatchAction(addFavourite, 'my favourite things');
|
||||
expect(testStatePart.getState().currentFavorites).to.include('my favourite things');
|
||||
});
|
||||
|
||||
tap.start();
|
||||
|
@ -56,7 +56,9 @@ export class StatePart<TStatePartName, TStatePayload> {
|
||||
/**
|
||||
* creates an action capable of modifying the state
|
||||
*/
|
||||
createAction <TActionPayload>(actionDef: IActionDef<TStatePayload, TActionPayload>): StateAction<TStatePayload, TActionPayload> {
|
||||
createAction<TActionPayload>(
|
||||
actionDef: IActionDef<TStatePayload, TActionPayload>
|
||||
): StateAction<TStatePayload, TActionPayload> {
|
||||
return new StateAction(actionDef);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user