Skip to content

Instantly share code, notes, and snippets.

@brakmic
Created April 11, 2017 08:41
Show Gist options
  • Save brakmic/7e85713b7debb23b1b20de219a5a1d89 to your computer and use it in GitHub Desktop.
Save brakmic/7e85713b7debb23b1b20de219a5a1d89 to your computer and use it in GitHub Desktop.
action creator for customer actions
import { Injectable } from '@angular/core';
import { Action } from '@ngrx/store';
import { ICustomer } from '../../interfaces';
import * as customer from '../customer.actions';
@Injectable()
export class CustomerActions {
public customerInit() {
return new customer.InitCustomerAction();
}
public customerInitialized(payload: ICustomer) {
return new customer.InitializedCustomerAction(payload);
}
public customerInitFailed() {
return new customer.InitFailedCustomerAction();
}
public customerSelected(payload: ICustomer) {
return new customer.CustomerSelectedAction(payload);
}
public customerChanged() {
return new customer.CustomerChangedAction();
}
public customerDeleted() {
return new customer.CustomerDeletedAction();
}
public customerSaved(payload: ICustomer) {
return new customer.CustomerSavedAction(payload);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment