How to use the rx-lite.config function in rx-lite

To help you get started, we’ve selected a few rx-lite examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / rx-lite / rx-lite-tests.ts View on Github external
function toPromise() {
		var promiseImpl: {
			new (resolver: (resolvePromise: (value: T) => void, rejectPromise: (reason: any) => void) => void): Rx.IPromise;
		} = undefined as any;

		Rx.config.Promise = promiseImpl;

		var p: Rx.IPromise = obsNum.toPromise(promiseImpl);

		p = obsNum.toPromise();

		p = p.then(x => x);
		p = p.then(x => p);
		p = p.then(undefined, reason => 10);
		//p = p.then(undefined, reason => p);

		var ps: Rx.IPromise = p.then(undefined, reason => "error");
		ps = p.then(x => "");
		ps = p.then(x => ps);
	}
}