Skip to content

Instantly share code, notes, and snippets.

@alxhub
Created May 27, 2015 18:36
Show Gist options
  • Save alxhub/31fbd863eea3f67b4fcd to your computer and use it in GitHub Desktop.
Save alxhub/31fbd863eea3f67b4fcd to your computer and use it in GitHub Desktop.
userSearchTactic(req:UserSeachRequest, ctx: Context): Rx.Observable<UserSearch> {
return ctx
.localDataStore
.objectsByType(User) // Rx.Observable<User>
.filter((user: User) => user.matches(req))
.reduce((user: User, results: UserSearch) => results.users.push(user), new UserSearch());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment