Skip to content

Instantly share code, notes, and snippets.

View bertrandg's full-sized avatar
:octocat:
 

bertrandg bertrandg

:octocat:
 
  • Lyon, FRANCE
View GitHub Profile
@bertrandg
bertrandg / ngrxintro.md
Created June 11, 2016 20:06 — forked from btroncone/ngrxintro.md
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

#Comprehensive Introduction to @ngrx/store By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@bertrandg
bertrandg / node-event-loop-demo.js
Created January 13, 2021 17:00 — forked from ghaiklor/node-event-loop-demo.js
This example shows how you can block event loop in NodeJS
'use strict';
// The purpose of this example is to show
// how you can block the event loop with JavaScript.
// There is 3 routes
// / respond with Hello, World text
// /block uses JavaScript while for 5 seconds
// /non-block uses setTimeout for 5 seconds
// Do the following
@bertrandg
bertrandg / ngrx-effects-advance-example.js
Last active October 3, 2022 02:22
ngrx/effects advance example
// Nothing changed here, works as previously.
@Effect() actionX$ = this.updates$
.ofType('ACTION_X')
.map(toPayload)
.switchMap(payload => this.api.callApiX(payload)
.map(data => ({type: 'ACTION_X_SUCCESS', payload: data}))
.catch(err => Observable.of({type: 'ACTION_X_FAIL', payload: err}))
);