This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { of } from 'rxjs/observable/of'; | |
| import { map } from 'rxjs/operators'; | |
| import { Observable } from 'rxjs/Observable'; | |
| const identity = <T, M extends keyof T>(...props: M[]) => map<T, { [M in keyof T]: T[M] }>(val => props.reduce((props, propName) => { | |
| props[propName] = val[propName]; | |
| return props; | |
| }, {} as { [M in keyof T]: T[M] })); | |
| interface Somethin { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { request } from 'universal-rxjs-ajax'; | |
| import { concatMap, map, filter, defaultIfEmpty } from 'rxjs/operators'; | |
| const pluck = (...args: string[]) => map(val => args.reduce((props, propName) => { | |
| props[propName] = val[propName]; | |
| return props; | |
| }, {})); | |
| request({ url: 'https://api.github.com/users/ajcrites/repos', method: 'GET' }).pipe( | |
| concatMap(({ response }) => response), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { zip } from 'rxjs/observable/zip'; | |
| import { interval } from 'rxjs/observable/interval'; | |
| import { from } from 'rxjs/observable/from'; | |
| import { delay } from 'rxjs/operators'; | |
| // Delay per-item. Also automatically completes once `from` completes | |
| zip( | |
| from([1, 2, 3]), | |
| interval(1000), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export interface Screen { | |
| screen: string; | |
| } | |
| export interface ResetScreen<T> extends Screen { | |
| passProps?: T; | |
| } | |
| export interface PushedScreen<T> extends ResetScreen<T> { | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| history | cut -c8- | \grep -Eo '^[^[:space:]]+| \| [^[:space:]]+' | sed 's/ \| //' | sort | uniq -c | sort -n |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| history | cut -c8- | \grep -Eo '^[^[:space:]]+| \| [^[:space:]]+' | sed 's/ \| //' | sort | uniq -c | sort -n |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
| { | |
| "rules": { | |
| "no-duplicate-variable": true, | |
| "no-unused-variable": [ | |
| true | |
| ], | |
| "no-console": [true, "log"], | |
| "angular-whitespace": [true, "check-interpolation"], | |
| "banana-in-box": true, | |
| "templates-no-negated-async": true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Sample {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Observable } from 'rxjs/Observable'; | |
| import { of } from 'rxjs/Observable/of'; | |
| import 'rxjs/add/observable/from'; | |
| import 'rxjs/add/operator/switch'; | |
| import 'rxjs/add/operator/first'; | |
| const addresses = [ | |
| {name: "a", primary: false}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Observable } from 'rxjs/Observable'; | |
| import 'rxjs/add/observable/interval'; | |
| import 'rxjs/add/operator/switchMap'; | |
| import 'rxjs/add/operator/map'; | |
| import 'rxjs/add/operator/mapTo'; | |
| Observable.interval(1000) | |
| .switchMap(() => Observable.interval(100)) |