This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as functions from 'firebase-functions'; | |
import * as admin from 'firebase-admin'; | |
import * as request from 'request'; | |
admin.initializeApp(); | |
// when a new user is registered | |
export const createUser = functions.firestore | |
.document('users/{userId}') | |
.onCreate(async (snap, _) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Effect with no Nx added | |
loadBrokersBasic$ = createEffect(() => | |
this.actions$.pipe( | |
ofType(BrokersActions.loadBrokers), | |
switchMap(action => { | |
return this.brokerApiService.getAllBrokers().pipe( | |
map(brokers => BrokersActions.loadBrokersSuccess({ brokers: [] })), | |
catchError(error => of(BrokersActions.loadBrokersFailure({ error }))) | |
); | |
}) |