Skip to content
Snippets Groups Projects
Commit 1d07b6a0 authored by David Sehnal's avatar David Sehnal
Browse files

renamed mol-comp to mol-task

parent 6d3565dc
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@
## Module Overview
- `mol-comp` Computation abstraction with progress tracking and cancellation support.
- `mol-task` Computation abstraction with progress tracking and cancellation support.
- `mol-data` Collections (integer based sets, inteface to columns/tables, etc.)
- `mol-math` Math related (loosely) algorithms and data structures.
- `mol-io` Parsing library. Each format is parsed into an interface that corresponds to the data stored by it.
......
File moved
File moved
File moved
File moved
File moved
File moved
......@@ -29,15 +29,21 @@ async function readData(path: string) {
}
}
function *test() {
yield 10;
return 15;
(Symbol as any).asyncIterator = (Symbol as any).asyncIterator || Symbol.for('Symbol.asyncIterator');
interface ProgressGenerator<T> extends AsyncIterableIterator<number | T> {
next(cont?: boolean): Promise<IteratorResult<number | T>>
}
async function *test(): ProgressGenerator<boolean> {
const r = yield await new Promise<number>(res => res(10));
return r;
}
async function runIt<T>(itP: () => IterableIterator<T>) {
async function runIt(itP: () => ProgressGenerator<boolean>) {
const it = itP();
while (true) {
const { value, done } = it.next();
const { value, done } = await it.next(true);
if (done) return value;
}
}
......
......@@ -9,7 +9,7 @@
"strictNullChecks": true,
"strictFunctionTypes": true,
//"downlevelIteration": true,
"lib": [ "es6", "dom" ],
"lib": [ "es6", "dom", "esnext.asynciterable" ],
"outDir": "build/node_modules",
"baseUrl": "src",
"paths": {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment