Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
class Share {
constructor(iterable) {
this.iterator = iterable[Symbol.asyncIterator]
? iterable[Symbol.asyncIterator]()
: iterable[Symbol.iterator]();
}
next() {
return this.iterator.next();
}
[Symbol.asyncIterator]() {
return this;
}
}
R.regConstructor(Share);
if (typeof DOMRect !== "undefined") R.regConstructor(DOMRect);
export function share(iterable) {
return new Share(iterable);
}
export const pipe = (...args) => (input, dispatch) =>
args.reduce((interm, step) => step(share(interm), dispatch), input);
export function run(...args) {
const { producer, event } = createProducer();
const main = pipe(...args);
R.regOpaqueObject(main);
return main(producer, event);
}
function id(v) {
thread.value = value;
thread.done = done;
this.cont.resume(thread);
}
reject(e) {
this.cont.reject(e);
}
}
function forkCont(i) {
const res = R.lock();
i.task[R.awaitSymbol](new ForkCont(i, res));
return res;
}
R.regConstructor(ForkCont);
async function* handleDelete(input) {
for await (const i of input) {
yield i;
if (i.type === "DELETE") {
for await (const i of input) {
if (i.type === "FLUSH") {
yield i;
return;
}
}
}
}
}
class Share {
constructor(iterable) {
this.iterator = iterable[Symbol.asyncIterator]
? iterable[Symbol.asyncIterator]()
: iterable[Symbol.iterator]();
}
next() {
return this.iterator.next();
}
[Symbol.asyncIterator]() {
return this;
}
}
R.regConstructor(Share);
if (typeof DOMRect !== "undefined") R.regConstructor(DOMRect);
export function share(iterable) {
return new Share(iterable);
}
export const pipe = (...args) => (input, dispatch) =>
args.reduce((interm, step) => step(share(interm), dispatch), input);
export function run(...args) {
const { producer, event } = createProducer();
const main = pipe(...args);
R.regOpaqueObject(main);
return main(producer, event);
}