Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
31 lines (26 sloc) 489 Bytes
open Wonka_types;
let fromPromise = promise =>
curry(sink => {
let ended = ref(false);
ignore(
Js.Promise.then_(
value => {
if (! ended^) {
sink(. Push(value));
sink(. End);
};
Js.Promise.resolve();
},
promise,
),
);
sink(.
Start(
(. signal) =>
switch (signal) {
| Close => ended := true
| _ => ()
},
),
);
});
You can’t perform that action at this time.