(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
(use '[clojure.core.match :only [match]]) | |
(defn evaluate [env [sym x y]] | |
(match [sym] | |
['Number] x | |
['Add] (+ (evaluate env x) (evaluate env y)) | |
['Multiply] (* (evaluate env x) (evaluate env y)) | |
['Variable] (env x))) | |
(def environment {"a" 3, "b" 4, "c" 5}) |
// sign up | |
account.signUp('joe@example.com', 'secret'); | |
// sign in | |
account.signIn('joe@example.com', 'secret'); | |
// sign in via oauth | |
account.signInWith('twitter'); | |
// sign out |
context.Configurations.ResponsePipeline.OnEntryEnded((a => | |
{ | |
Type entityType = dataServiceContext.ResolveType(a.Entry.TypeName); | |
if (typeof(Product).IsAssignableFrom(entityType)) | |
{ | |
var properties = a.Entry.Properties as List<ODataProperty>; | |
if (properties == null) | |
{ | |
properties = new List<ODataProperty>(a.Entry.Properties); | |
} |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
<?php | |
/* | |
Backup script for trakt.tv (API v2). | |
Live demo: https://darekkay.com/blog/trakt-tv-backup/ | |
*/ | |
// create a Trakt app to get a client API key: http://docs.trakt.apiary.io/#introduction/create-an-app | |
$apikey = "CLIENT_API_KEY"; |
gulp.task('ngBuild',function(){ | |
var builder = new Builder(); | |
return builder.loadConfig('./jspm.conf.js') | |
.then(function(){ | |
builder.config({ | |
traceurOptions: { | |
annotations: true, | |
types: true, | |
memberVariables: true | |
}, |
/* bling.js */ | |
window.$ = document.querySelectorAll.bind(document); | |
Node.prototype.on = window.on = function (name, fn) { | |
this.addEventListener(name, fn); | |
} | |
NodeList.prototype.__proto__ = Array.prototype; |
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
A complete list of RxJS 5 operators with easy to understand explanations and runnable examples.
function translateError(msg) { | |
var newErr = new Error(msg); // placed here to get correct stack | |
return e => { | |
newErr.originalError = e; | |
throw newErr; | |
} | |
} | |
async function asyncTask() { | |
const user = await UserModel.findById(1).catch(translateError('No user found')) |