Created
April 11, 2017 10:47
-
-
Save brakmic/f24e57d5fa64a43223d088cb96cdd453 to your computer and use it in GitHub Desktop.
handling customer effects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Injectable() | |
export class CustomerEffects { | |
@Effect() customerSelected$: Observable<Action> = this.actions$ | |
.ofType(CustomerActionTypes.SELECTED) | |
.map(action => { | |
let customer: ICustomer = _.cloneDeep(action.payload); | |
customer.active_debt = this.paymentService.activeDebt(customer.id); | |
customer.picture = this.imageService.imageUrl(customer.id); | |
return this.customerActions.customerInitialized(customer); | |
}); | |
constructor(private store: Store<IAppState>, | |
private actions$: Actions, | |
private customerActions: CustomerActions, | |
private paymentService: PaymentService, | |
private imageService: ImageService) { } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment