Effects and store v2 are not on npm yet, so download them from my github.
"@ngrx/core": "1.0.0",
"@ngrx/store": "fxck/store#v2-test",
"@ngrx/effects": "fxck/effects",
function maybeFilter(array, predicate) { | |
var newArray; | |
array.forEach((item, i) => { | |
if (predicate(item)) { | |
if (newArray) { | |
newArray.push(item) | |
} | |
} else if (!newArray) { | |
newArray = array.slice(0, i) | |
} |
(function(A,n,g,u,l,a,r){A.GoogleAnalyticsObject=r;A[l]=A[l]||function(){ | |
(A[l].q=A[l].q||[]).push(arguments)},A[l].l=1*new Date();a=n.createElement(g), | |
r=n.getElementsByTagName(g)[0];a.async=1;a.src=u;r.parentNode.insertBefore(a,r) | |
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); | |
ga('create', 'UA-XXXXXXXX-XX', 'auto'); | |
ga('send', 'pageview'); |
/* | |
* Be sure to drink your Ovaltine | |
* | |
* If you are a JavaScript nerd supreme: | |
*/ | |
/* | |
* ...should all output "true" | |
* | |
* bonus for avoiding for loops |
expect(fn).toThrow(e); | |
expect(instance).toBe(instance); | |
expect(mixed).toBeDefined(); | |
expect(mixed).toBeFalsy(); | |
expect(number).toBeGreaterThan(number); | |
expect(number).toBeLessThan(number); | |
expect(mixed).toBeNull(); | |
expect(mixed).toBeTruthy(); | |
expect(mixed).toBeUndefined(); | |
expect(array).toContain(member); |
./src/app/app.component.html | |
<md-sidenav-layout> | |
<md-toolbar color="primary"> | |
<span> | |
Brand | |
</span> | |
<app-content-outlet [id]="'topnav'"></app-content-outlet> | |
<button md-icon-button (click)="sidenav.toggle()"> | |
<md-icon>menu</md-icon> |
import * as gulp from 'gulp'; | |
import {gulpPrerender} from '@angular/universal'; | |
import {App} from './app'; | |
gulp.task("prerender", () => { | |
return gulp.src(['index.html']) | |
.pipe(gulpPrerender({ | |
directives: [App] | |
})); | |
}); |
const PREFIX = 'synaptic' | |
const NpmRegExp = /^@?[a-z0-9\-]*([a-z0-9\-])?$/ | |
export default function requireByKind ( kind, given ) { | |
// Avoid access to specific files by restricting the `given` | |
if ( given.match( NpmRegExp ) ) { | |
throw new Error( `only alphanumeric names are valid` ) | |
} |
Facebook tutorials and resources:
Why be interested: