I am looking at some legacy code and they have created all the redux reducers as instance methods of a class:
@Injectable()
export class PeopleActions {
constructor(private ngRedux: NgRedux<any>) {}
add() {
this.ngRedux.dispatch({ADD, payload: {foo: 'bar;});
}
remove() {
this.ngRedux.dispatch({Remove, payload: {foo: 'bar;});
}
// etc.
I would normally create these as sepreate functions
export function add { // etc.}
export function remove { // etc.}
And then create a union:
type MyActions = add | remove;
Can I somehow create a union of the class instance methods?