Mirror: 馃帺 A tiny but capable push & pull stream library for TypeScript and Flow
at v3.2.2 350 B view raw
1open Wonka_types; 2open Wonka_helpers; 3 4let fromArray = arr => 5 curry(sink => { 6 let size = Rebel.Array.size(arr); 7 let index = ref(0); 8 9 makeTrampoline(sink, (.) => 10 if (index^ < size) { 11 let x = Rebel.Array.getUnsafe(arr, index^); 12 index := index^ + 1; 13 Some(x); 14 } else { 15 None; 16 } 17 ); 18 });