Skip to content

Instantly share code, notes, and snippets.

@splincode
Created October 6, 2019 19:28
Show Gist options
  • Save splincode/08bb74f51044c42e339e67c8494ecee8 to your computer and use it in GitHub Desktop.
Save splincode/08bb74f51044c42e339e67c8494ecee8 to your computer and use it in GitHub Desktop.
@State<PreferencesStateModel>({ ... })
export class PreferencesState { ... }
@State<string[]>({ ... })
export class ZooState {
@Selector([PreferencesState])
public static firstLocalPanda(state: string[], preferencesState: PreferencesStateModel) {
return state.find(val => val.indexOf('panda') > -1 && val.indexOf(preferencesState.location));
}
@Selector([ZooState.firstLocalPanda])
public static happyLocalPanda(state: string[], panda: string) {
return 'happy ' + panda;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment