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!
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!
// Here, we create a default Observable, which manages some costly resource | |
// or performs some heavy computation (denoted by the crying emoji) to push | |
// values to it's Observers. Now imagine, this could be a http call, | |
// database connection or socket connection, etc ... | |
// | |
// Each subscribed Observer gets an independent execution context. | |
// If we had only a single subscribe call - everything would be fine. | |
// We'd have just a single execution, and the costly resource is allocated | |
// just one time. So far, so good. | |
// |
// https://gist.github.com/dinony/60332358d25fd18d561395e0b8bf807c | |
// In the above Gist, we've discussed the constraints of unicast Observables, | |
// when it comes to sharing a costly resource. | |
// | |
// Here, you'll see how Subjects can be used to avoid this problematic scenario. | |
import {Obervable} from 'rxjs/Observable'; | |
import {Subject} from 'rxjs/Subject'; | |
// Again, we have our default Observable, which manages some costly resource. | |
const obs = new Observable(observer => { |
With the release of Node 6.0.0, the surface of code that needs transpilation to use ES6 features has been reduced very dramatically.
This is what my current workflow looks like to set up a minimalistic and fast microservice using micro and async
+ await
.
{ | |
"presets": ["es2015"], | |
"plugins": ["transform-runtime"] | |
} |
log_format bunyan '{' | |
'"name": "nginx/$nginx_version",' | |
'"hostname": "$hostname",' | |
'"pid": "$pid",' | |
'"level": 30,' | |
'"time": "$time_iso8601",' | |
'"v": 0,' | |
'"msg": "access",' | |
'"remoteAddress": "$remote_addr",' |
'use strict'; | |
function counter($timeout){ | |
var i = 0; | |
return (function(){ | |
i += 1; | |
return i; | |
}); | |
} |
https://github.com/gslin/coscup2015-mysql-hands-on | |
開場 | |
# Transaction | |
## 原子不可分割性 | |
要碼全部成功不然就全部失敗 - 銀行轉帳 (林益世 v.s. 陳啟祥) | |
持久性 (D) |
#!/bin/bash | |
files=$(git diff --cached --name-only | grep '\.js$') | |
# Prevent ESLint help message if no files matched | |
if [[ $files = "" ]] ; then | |
exit 0 | |
fi | |
echo $files | xargs eslint |