fix(core): update

This commit is contained in:
Philipp Kunz 2019-02-27 02:00:47 +01:00
parent a4d43456d7
commit c5a3eb63ad
4 changed files with 8 additions and 6 deletions

View File

@ -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();

View File

@ -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);
}