store icon indicating copy to clipboard operation
store copied to clipboard

Action Handler Decorator

Open amcdnl opened this issue 8 years ago • 3 comments

I have code like this:

    this._actions
      .pipe(ofActionDispatched(SelectFolderSuccess), takeUntil(this._destroy$))
      .subscribe(({ payload }) => this.onSelectFolderSuccess(payload));

I want to have code like this instead:

@ActionHandler(SelectFolderSuccess)
onSelectFolderSuccess(payload) { ... }

2 Challenges:

  • Need a way to bind the fn to the appropriate context once the action is invoked
  • Need a way to unsubscribe on destroy

Reference: https://github.com/angular/angular/issues/23038#issuecomment-381670075

amcdnl avatar Apr 17 '18 13:04 amcdnl

Closing and marking for future.

amcdnl avatar May 08 '18 13:05 amcdnl

Any update on this? 🙁 It's kind of annoying to have to write unsubscribe boilerplate for every action handler.

finnlock avatar Feb 16 '19 08:02 finnlock

any update?

MatissJanis avatar Sep 02 '19 07:09 MatissJanis