@kangax created a new interesting quiz, this time devoted to ES6 (aka ES2015). I found this quiz very interesting and quite hard (made myself 3 mistakes on first pass).
Here we go with the explanations:
(function(x, f = () => x) {| echo %USERPROFILE% | |
| C:\Users\Orest |
| var Middleware = function() {}; | |
| Middleware.prototype.use = function(fn) { | |
| var self = this; | |
| this.go = (function(stack) { | |
| return function(next) { | |
| stack.call(self, function() { | |
| fn.call(self, next.bind(self)); | |
| }); |
@kangax created a new interesting quiz, this time devoted to ES6 (aka ES2015). I found this quiz very interesting and quite hard (made myself 3 mistakes on first pass).
Here we go with the explanations:
(function(x, f = () => x) {| (function(self) { | |
| 'use strict'; | |
| if (self.fetch) { | |
| return | |
| } | |
| function normalizeName(name) { | |
| if (typeof name !== 'string') { | |
| name = String(name) |
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
Go to File -> Settings -> Tools -> Terminal and change Shell path based on the the installed git version.
for 64bit:
"C:\Program Files\Git\bin\sh.exe" --login -ifor 32bit:
"C:\Program Files (x86)\Git\bin\sh.exe" --login -i| import { Directive, ElementRef, forwardRef, Input, Renderer2 } from '@angular/core'; | |
| import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; | |
| import { fromEvent } from 'rxjs/observable/fromEvent'; | |
| import { merge } from 'rxjs/observable/merge'; | |
| import { timer } from 'rxjs/observable/timer'; | |
| import { Subscription } from 'rxjs/Subscription'; | |
| export const DEFAULT_VALUE_ACCESSOR : any = { | |
| provide: NG_VALUE_ACCESSOR, | |
| useExisting: forwardRef(() => NgControlOptionsDirective), |
| const PENDING = 1; | |
| const RESOLVED = 2; | |
| const REJECTED = 3; | |
| const callLater = (fn) => setTimeout(fn, 0); | |
| class Promise { | |
| constructor(initPromiseFn) { | |
| this._state = PENDING; | |
| this._value = undefined; |