Skip to content

Instantly share code, notes, and snippets.

@ddoronin
Created April 1, 2019 02:10
Show Gist options
  • Save ddoronin/c0133b16d3da8f9c8e77e234423ca5f3 to your computer and use it in GitHub Desktop.
Save ddoronin/c0133b16d3da8f9c8e77e234423ca5f3 to your computer and use it in GitHub Desktop.
Request Model
import { Subject } from "rxjs";
import { Option } from "monas";
export interface IRequest {
uri: string;
headers: { [key: string]: string };
time: number;
}
export default class RequestComposer {
public request$: Subject<Option<IRequest>>;
constructor() {
this.request$ = new Subject<Option<IRequest>>();
}
public set(req: Option<IRequest>) {
this.request$.next(req);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment