Skip to content

Instantly share code, notes, and snippets.

@erik-slack
Last active May 26, 2021 19:18
Just the map so far.
// I'm the map! 🎵
const cache = new Map();
@Injectable()
export class UsersEffects {
loadUsers$ = createEffect(() =>
this.actions$.pipe(
ofType(UsersActions.loadUsers),
switchMap((action) => {
const callable = this.fns.httpsCallable(USER_ENDPOINT);
const reqPayload = {
op: 'list',
startAfter: action.cursorId,
length: action.pageSize
};
return callable(reqPayload).pipe(
map((response) => UsersActions.loadUsersSuccess({ users: response.users }))
);
})
)
);
constructor(
private actions$: Actions,
private fns: AngularFireFunctions
) {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment