Files
grungnet/src/actions/RemoveStatesAction.ts
Mitchell McCaffrey d80bfa2f1e typescript
2021-07-16 14:55:33 +10:00

22 lines
439 B
TypeScript

import Action from "./Action";
import { omit } from "../helpers/shared";
import { ID } from "../types/Action";
class RemoveStatesAction<State extends ID> extends Action<
Record<string, State>
> {
stateIds: string[];
constructor(stateIds: string[]) {
super();
this.stateIds = stateIds;
}
update(statesById: Record<string, State>) {
return omit(statesById, this.stateIds);
}
}
export default RemoveStatesAction;