I hereby claim:
- I am qwtel on github.
- I am qwtel (https://keybase.io/qwtel) on keybase.
- I have a public key ASCbFur24236CAj1oGXKHjjTVGaT35JcTLQNXvXUFG7aOwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
function fetchRx(url, options) { | |
const controller = new AbortController(); | |
const { signal } = controller; | |
return Observable.create(observer => { | |
fetch(url, { signal, ...options }) | |
.then(x => observer.next(x)) | |
.catch(x => observer.error(x)) | |
.finally(() => observer.complete()) | |
return () => controller.abort(); | |
}); |
/* | |
* Copyright (c) 2018 Florian Klampfer <https://qwtel.com/> | |
* | |
* This software uses portions of `sigV4Client.js`, | |
* which is Apache-2.0 licensed with the following copyright: | |
* | |
* > Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. | |
* | |
* Changes: | |
* * Replaced "crypto-js" with Web Cryptography API |
var createElement = document.createElement.bind(document); | |
function appendChild(child) { | |
this.appendChild( | |
child instanceof Element ? child : document.createTextNode(child) | |
); | |
} | |
document.createElement = function(tagName, attrs, children) { | |
var el = createElement(tagName); |
// Quick-and-Dirty `Set` implementation. | |
/* eslint-disable */ | |
export const Set = global.Set || function (a = []) { | |
a = a.filter((x, i) => i === a.indexOf(x)); | |
a.size = a.length; | |
a.has = x => a.indexOf(x) > -1; | |
a.add = x => { if (!a.has(x)) { a.size++; a.push(x); } return a; }; | |
a.delete = x => { let t; if (t = a.has(x)) { a.size--; delete a[a.indexOf(x)]; } return t; }; | |
a.keys = a.values = () => a[Symbol.iterator](); | |
a.clear = () => { while (a.pop()) {} a.size = 0; }; |
Comparison of selected data serialization formats.
|| JSON | EDN | CLJ
// Node 8+ | |
// -------------------------------------------------------------- | |
// No external dependencies | |
const { promisify } = require('util'); | |
const { resolve } = require('path'); | |
const fs = require('fs'); | |
const readdir = promisify(fs.readdir); | |
const stat = promisify(fs.stat); |
function filterWithAll(p$, ...others) { | |
if (process.env.DEBUG && !p$) throw Error(); | |
else if (others.length === 0) { | |
return this::withLatestFrom(p$)::filter(([, p]) => p)::map(([x]) => x); | |
} else { | |
return this::withLatestFrom(p$, ...others) | |
::filter(([, ...ps]) => ps.every(p => p)) | |
::map(([x]) => x); | |
} | |
} |
import { Observable } from 'rxjs/Observable'; | |
/** | |
* Creates an observable that emits samples from an easing function on every animation frame | |
* for a duration `d` ms. | |
* | |
* The first emitted value will be a sample form the easing function at `t = 0`, | |
* and the last emitted value is guaranteed to be the easing function at `t = d`. | |
* | |
* It can be used with any of [Robert Penner's easing functions](http://robertpenner.com/easing/), |