SHARE
TWEET

Untitled

a guest Aug 25th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. export interface CampaignStateModel {
  2.   campaignName: string;
  3.   audiences: Audience[];
  4.   selectedAudiences: int[];
  5. }
  6.  
  7. export const initialCampaignStateModel: CampaignStateModel = {
  8.   campaignName: "",
  9.   audiences: [{ id: 1, name: "audience 1" }, { id: 2, name: "audience 2" }, { id: 3, name: "audience 3" }],
  10.   selectedAudiences: []
  11. };
  12.  
  13. @State<CampaignStateModel>({
  14.   name: 'campaign',
  15.   defaults: initialCampaignStateModel
  16. })
  17. export class CampaignState {
  18.  
  19.   @Action(SelectAudiences)
  20.   selectAudiences(
  21.     { patchState }: StateContext<CampaignState>,
  22.     { selectedAudiences }: SelectAudiences
  23.   ) {
  24.     patchState({      
  25.       selectedAudiences
  26.     });
  27.   }
  28.  
  29.   @Action(SetCampaignName)
  30.   setCampaignName() {
  31.   }
  32.  
  33.   @Action(LoadAudiences)
  34.   loadAudiences() {
  35.   }
  36. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top