You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

55 lines
1.3 KiB

<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<title>TODO supply a title</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div>TODO write content</div>
<script type="module">
import { join, all, put } from '../index.js';
const v = (n, v = 'ok') => ({[n]: v});
const createTask = (text, timeout, p) => {
return (data) => new Promise(resolve => {
setTimeout(() => resolve(text), timeout);
});
}
const createTask2 = (text) => {
return join(text, createTask(v('p-two'), 100));
}
const subtask = join(
v('subtask-tree'),
createTask2(v('subtask-one')),
createTask(null, 100)
);
const task = join(
all(
() => false,
createTask(v('z-one'), 100, 'all'),
createTask(v('z-two'), 100, 'all')
),
() => false,
createTask(v('one'), 100),
createTask(undefined, 100),
put('put-false', false),
put('put-undefined', undefined),
put('put-subtask', console.log),
subtask,
v('tree'),
);
task({ [`put-subtask`]: { p: 0 } }).then(console.log);
</script>
</body>
</html>