This file contains 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 * as ts from 'typescript'; | |
function makeEnum() { | |
return ts.createEnumDeclaration( | |
undefined, | |
[ts.createToken(ts.SyntaxKind.ExportKeyword), ts.createToken(ts.SyntaxKind.DeclareKeyword)], | |
'Direction', | |
[ | |
ts.createEnumMember('UNKNOWN', ts.createLiteral(0)), | |
ts.createEnumMember('NORTH'), |
This file contains 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 Foo { | |
baz: number; | |
} | |
export interface StaticClass<InstanceType = any> { | |
new (...args: any[]): InstanceType; | |
} |
This file contains 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 { EntityAdapter, EntityState } from '@ngrx/entity'; | |
import { ActionReducer } from '@ngrx/store'; | |
import { CommandReducer, ReducerCommand } from 'ngrx-command-reducer'; | |
import { BaseAction, StaticAction } from './base.actions'; | |
type PayloadActionFunction<S, P> = (p: P, s: S) => S; | |
type PayloadlessActionFunction<S> = (s: S) => S; | |
export type EntityFunction<S, P> = PayloadActionFunction<S, P> | PayloadlessActionFunction<S>; | |
export class EntityCommandReducer<Entity, State extends EntityState<Entity>, Action extends BaseAction> { |
This file contains 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 { retryExponentialBackoff } from './exponential-backoff'; | |
let attemptCount = 0; | |
Observable.create(function (observer) { | |
console.log('observable tried', attemptCount++); | |
observer.error(new Error('fail')); | |
}) | |
.let(retryExponentialBackoff({ | |
maxRetries: 3, |
This file contains 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
<pre>NgZone has been stable for {{stableSinceSecondsAgo | async | number:'.3-3'}} seconds</pre> |