Skip to content

Instantly share code, notes, and snippets.

@electrichead
electrichead / example.ts
Created April 13, 2022 19:18
forkJoin vs. race with timer
import { timer, race, forkJoin, of, throwError } from 'rxjs';
import { concatMap, map, catchError } from 'rxjs/operators';
let resolvePromise;
let rejectPromise;
const prom = new Promise((resolve, reject) => {
resolvePromise = resolve;
rejectPromise = reject;
});
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="width=320; user-scalable=no" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>ColorThief Demo</title>
<script type="text/javascript" charset="utf-8" src="jquery-2.0.0.min.js"></script>
<script type="text/javascript" charset="utf-8" src="quantize.js"></script>
<script type="text/javascript" charset="utf-8" src="color-thief.js"></script>