-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
47 lines (43 loc) · 1.03 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Monad</title>
<!--<script type="text/javascript" src="lib/monad_ts.umd.min.js"></script>-->
<script type="text/javascript" src="lib/monad_ts.umd.js"></script>
</head>
<body>
<div class="input">
<form>
<input id="press" autofocus>
<button id="btn" >press</button>
</form>
</div>
<script>
const list = new Monad_ts.List();
let f1 = new Monad_ts.AsyncFlow(5)
.bind((v) => v)
.then((v) => v)
.then((v) => Monad_ts.cast(list.bind((v) => [v-1, v, v+1], [v]), 1))
.then(v=> Monad_ts.wait(v,3000))
.then((v)=> console.log(v));
console.log(f1);
var func = (v) => {
v.x=10;
return v;
};
var f = new Monad_ts.Flow({x: 1}).bind(v=>func(v)).subscribe();
console.log(f);
var m = new Monad_ts.State({q:1, w:2});
console.log(m.get());
var maybe = new Monad_ts.Maybe();
var z = {
url: 'http://...',
getUrl: function (){
return this.url;
}
};
console.log(maybe.bind(r => r.getUrl(), z));
</script>
</body>
</html>