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 { ReplaySubject } from 'rxjs/ReplaySubject'; | |
import { Observable } from 'rxjs/Observable'; | |
export abstract class ReplayStore<T> { | |
private _isInitialized = false; | |
private _state: T; | |
private _state$: ReplaySubject<T>; | |
constructor() { |
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
#!/usr/bin/env bash | |
# Generate private key and CSR. | |
openssl req -nodes -newkey rsa:2048 -keyout ssl/server.key -out ssl/server.csr -subj "//CN=devserver" | |
# Auto-signing. | |
#openssl req -x509 -sha256 -days 365 -key ssl/server.key -in ssl/server.csr -out ssl/server.pem | |
openssl x509 -req -days 365 -in ssl/server.csr -signkey ssl/server.key -out ssl/server.crt | |
# Removing CSR. |
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
// Create an order. | |
POST /orders | |
request = { | |
title: 'TITLE', | |
description: 'DESCRIPTION' | |
} | |
response = { | |
id: 'ORDER_ID', | |
title: 'TITLE', |
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 { Component } from '@angular/core'; | |
import { interval } from 'rxjs'; | |
@Component({ | |
template: `<div>{{ count$ | async }}</div>` | |
}) | |
export class CounterComponent { | |
count$ = 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
import { Component } from '@angular/core'; | |
import { Subscription, interval } from 'rxjs'; | |
@Component({ | |
template: `<div>{{ count }}</div>` | |
}) | |
export class CounterComponent implements OnDestroy, OnInit { | |
count: number; | |
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 { Component, OnDestroy, OnInit } from '@angular/core'; | |
import { Subject, interval } from 'rxjs'; | |
import { takeUntil } from 'rxjs/operators'; | |
@Component({ | |
template: ` | |
<div>{{ count }}</div> | |
<button (click)="startCounting()">Start Counting</button> | |
` | |
}) |
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 { Component, OnInit } from '@angular/core'; | |
import { Scavenger } from '@wishtack/rx-scavenger'; | |
import { interval } from 'rxjs'; | |
@Component({ | |
template: `<div>{{ count }}</div>` | |
}) | |
export class CounterComponent implements OnDestroy, OnInit { | |
count: number; |
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 { Component, OnInit } from '@angular/core'; | |
import { Scavenger } from '@wishtack/rx-scavenger'; | |
import { interval } from 'rxjs'; | |
@Component({ | |
template: `<div>{{ count }}</div>` | |
}) | |
export class CounterComponent implements OnDestroy, OnInit { | |
count: number; |
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
@Component({ | |
selector: 'wt-logo', | |
template: `<img [src]="logoUrl">` | |
}) | |
export LogoComponent { | |
logoUrl = require('!!url-loader!./logo.svg'); | |
} |