├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── bsconfig.json ├── package.json ├── shell.nix ├── src └── Rxjs.res └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | .merlin 2 | node_modules 3 | lib -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | #7.5.6 2 | Increased cardinality limit to 7 for operators -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Noble Artificial Intelligence, Inc. ("Noble.AI") 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # rescript-rxjs 2 | 3 | Rescript bindings for Rxjs (https://rxjs.dev/) 4 | 5 | https://github.com/noble-ai/rescript-rxjs 6 | 7 | ## Installation 8 | 9 | * Add `@nobleai/rescript-rxjs` to your project as you like 10 | * Add `@nobleai/rescript-rxjs` to `bs-dev-dependencies`in bsconfig.json 11 | * build `-with-deps` 12 | -------------------------------------------------------------------------------- /bsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@nobleai/rescript-rxjs", 3 | "sources": ["src"] 4 | } 5 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@nobleai/rescript-rxjs", 3 | "version": "7.5.17", 4 | "description": "Rescript bindings for Rxjs", 5 | "type": "module", 6 | "files": [ 7 | "README.md", 8 | "Changes.md", 9 | "LICENSE", 10 | "bsconfig.json", 11 | "src/**/*.res", 12 | "src/**/*.resi" 13 | ], 14 | "scripts": { 15 | "build": "rescript build", 16 | "start": "rescript build -w", 17 | "clean": "rescript clean", 18 | "test": "echo 'tests disabled for now'", 19 | "pub": "yarn publish --scope nobleai --access public" 20 | }, 21 | "keywords": [ 22 | "rescript", 23 | "rxjs" 24 | ], 25 | "author": "Alex Mouton ", 26 | "license": "MIT", 27 | "repository": { 28 | "type": "git", 29 | "url": "git+ssh://github.com/noble-ai/rescript-rxjs.git" 30 | }, 31 | "devDependencies": { 32 | "rescript": "^9.1.4", 33 | "rxjs": "^7.5.5" 34 | }, 35 | "peerDependencies": { 36 | "rxjs": "^7.5.5" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /shell.nix: -------------------------------------------------------------------------------- 1 | { nixpkgs ? import {} }: 2 | nixpkgs.mkShell { 3 | # nativeBuildInputs is usually what you want -- tools you need to run 4 | nativeBuildInputs = [ 5 | nixpkgs.git 6 | nixpkgs.sapling 7 | nixpkgs.gh 8 | nixpkgs.yarn 9 | ]; 10 | } 11 | -------------------------------------------------------------------------------- /src/Rxjs.res: -------------------------------------------------------------------------------- 1 | // Observables have a few different implementations 2 | // and some other behaviour based on their pipeline. 3 | 4 | // DEVELOPERS NOTE: dont use auto formatting for this file, it makes it way worse, 5 | // having these repeating long signatures on line line each allows comparison from one to the next as we add new args 6 | 7 | // These types track what kind the observable is operating with. 8 | 9 | // Types for describing the "class" of an observable 10 | type foreign // custom or otherwise 11 | 12 | // Subject based observables can be emitted to will have use source etc as their source type 13 | // Custom observables and observables derived from multiple sources will have void source type 14 | type source<'a> 15 | type void 16 | 17 | // Observable 18 | // class is a 'phantom type' to flag the implementation. see Class types above 19 | // a is the source type for a subject, behaviorsubject 20 | // Custom / Hot observables should be 'void' 21 | // b is the output type. 22 | type t<'class, 'a, 'b> 23 | 24 | type err 25 | type subscription 26 | type scheduler 27 | 28 | let void: t<'class, 'source, 'b> => unit = _ => () 29 | 30 | module Observer = { 31 | // making functions be uncurried so the currying system doesnt 32 | // step in and break this binding? - AxM 33 | type t<'a> = { 34 | next: (. 'a) => unit, 35 | complete: (. unit) => unit, 36 | error: (. err) => unit, 37 | } 38 | } 39 | 40 | @module("rxjs") 41 | external asyncScheduler: scheduler = "asyncScheduler" 42 | 43 | @module("rxjs") 44 | external asapScheduler: scheduler = "asapScheduler" 45 | 46 | module Observable = { 47 | type t<'a> = t 48 | @module("rxjs") @new 49 | external make: (Observer.t<'source> => option unit>) => t<'source> = "Observable" 50 | } 51 | 52 | // Subject classes 53 | type natural 54 | type behavior 55 | type async 56 | type replay 57 | 58 | // subject class 59 | type subject<'behavior> 60 | 61 | module Subject = { 62 | // type t<'a> = t, source<'a>, 'a> 63 | @module("rxjs") @new external make: 'a => t, source<'a>, 'a> = "Subject" 64 | @module("rxjs") @new external makeEmpty: unit => t, source<'a>, 'a> = "Subject" 65 | @module("rxjs") @new 66 | external makeBehavior: 'a => t, source<'a>, 'a> = "BehaviorSubject" 67 | @module("rxjs") @new 68 | external makeAsync: unit => t, source<'a>, 'a> = "AsyncSubject" 69 | @module("rxjs") @new 70 | external makeReplay: int => t, source<'a>, 'a> = "ReplaySubject" 71 | 72 | } 73 | 74 | // An Rxjs.t that has a source type is an "Observer" and can recieve values 75 | @send external next: (t<'c, source<'a>, 'out>, 'a) => unit = "next" 76 | @send external complete: t<'c, source<'a>, 'out> => unit = "complete" 77 | @send external error: (t<'c, source<'a>, 'out>, 'err) => unit = "error" 78 | 79 | @send external pipe: (t<'class, 'source, 'a>, (. t<'class, 'source, 'a>) => t<'class, 'source, 'b>) => t<'class, 'source, 'b> = "pipe" 80 | @send external pipe2: (t<'class, 'source, 'a>, ((. t<'class, 'source, 'a>) => t<'class, 'source, 'b>), ((. t<'class, 'source, 'b>) => t<'class, 'source, 'c>)) => t<'class, 'source, 'c> = "pipe" 81 | @send external pipe3: (t<'class, 'source, 'a>, ((. t<'class, 'source, 'a>) => t<'class, 'source, 'b>), ((. t<'class, 'source, 'b>) => t<'class, 'source, 'c>), ((. t<'class, 'source, 'c>) => t<'class, 'source, 'd>)) => t<'class, 'source, 'd> = "pipe" 82 | @send external pipe4: (t<'class, 'source, 'a>, ((. t<'class, 'source, 'a>) => t<'class, 'source, 'b>), ((. t<'class, 'source, 'b>) => t<'class, 'source, 'c>), ((. t<'class, 'source, 'c>) => t<'class, 'source, 'd>), ((. t<'class, 'source, 'd>) => t<'class, 'source, 'e>)) => t<'class, 'source, 'e> = "pipe" 83 | @send external pipe5: (t<'class, 'source, 'a>, ((. t<'class, 'source, 'a>) => t<'class, 'source, 'b>), ((. t<'class, 'source, 'b>) => t<'class, 'source, 'c>), ((. t<'class, 'source, 'c>) => t<'class, 'source, 'd>), ((. t<'class, 'source, 'd>) => t<'class, 'source, 'e>), ((. t<'class, 'source, 'e>) => t<'class, 'source, 'f>)) => t<'class, 'source, 'f> = "pipe" 84 | @send external pipe6: (t<'class, 'source, 'a>, ((. t<'class, 'source, 'a>) => t<'class, 'source, 'b>), ((. t<'class, 'source, 'b>) => t<'class, 'source, 'c>), ((. t<'class, 'source, 'c>) => t<'class, 'source, 'd>), ((. t<'class, 'source, 'd>) => t<'class, 'source, 'e>), ((. t<'class, 'source, 'e>) => t<'class, 'source, 'f>), ((. t<'class, 'source, 'f>) => t<'class, 'source, 'g>)) => t<'class, 'source, 'g> = "pipe" 85 | @send external pipe7: (t<'class, 'source, 'a>, ((. t<'class, 'source, 'a>) => t<'class, 'source, 'b>), ((. t<'class, 'source, 'b>) => t<'class, 'source, 'c>), ((. t<'class, 'source, 'c>) => t<'class, 'source, 'd>), ((. t<'class, 'source, 'd>) => t<'class, 'source, 'e>), ((. t<'class, 'source, 'e>) => t<'class, 'source, 'f>), ((. t<'class, 'source, 'f>) => t<'class, 'source, 'g>), ((. t<'class, 'source, 'g>) => t<'class, 'source, 'h>)) => t<'class, 'source, 'h> = "pipe" 86 | 87 | @send external subscribe: (t<'class, 'source, 'a>, Observer.t<'a>) => subscription = "subscribe" 88 | @send external subscribe_: (t<'class, 'source, 'a>, Observer.t<'a>) => unit = "subscribe" 89 | @send external unsubscribe: subscription => unit = "unsubscribe" 90 | 91 | external toObservable: t<'c, 's, 'a> => Observable.t<'a> = "%identity" 92 | external toObserver: t<'c, source<'s>, 'a> => Observer.t<'s> = "%identity" 93 | 94 | @module("rxjs") external buffer: (t<'ca, 'sa, 'a>) => (. t<'cb, 'sb, 'b>) => t<'cb, 'sb, array<'b>> = "buffer" 95 | @module("rxjs") external catchError: (err => t<'class, 'source, 'a>) => (. t<'class, 'source, 'a>) => t<'class, 'source, 'a> = "catchError" 96 | @module("rxjs") external takeUntil: (t<'cu, 'su, 'ou>) => (. t<'cb, 'sb, 'b>) => t<'cb, 'sb, 'b> = "takeUntil" 97 | @module("rxjs") external combineLatest2: (t<'ca, 'sa, 'a>, t<'cb, 'sb, 'b>) => t = "combineLatest" 98 | @module("rxjs") external combineLatest3: (t<'ca, 'sa, 'a>, t<'cb, 'sb, 'b>, t<'cc, 'sc, 'c>) => t = "combineLatest" 99 | @module("rxjs") external combineLatest4: (t<'ca, 'sa, 'a>, t<'cb, 'sb, 'b>, t<'cc, 'sc, 'c>, t<'cd, 'sd, 'd>) => t = "combineLatest" 100 | @module("rxjs") external combineLatest5: (t<'ca, 'sa, 'a>, t<'cb, 'sb, 'b>, t<'cc, 'sc, 'c>, t<'cd, 'sd, 'd>, t<'ce, 'se, 'e>) => t = "combineLatest" 101 | @module("rxjs") external combineLatest6: (t<'ca, 'sa, 'a>, t<'cb, 'sb, 'b>, t<'cc, 'sc, 'c>, t<'cd, 'sd, 'd>, t<'ce, 'se, 'e>, t<'cf, 'sf, 'f>) => t = "combineLatest" 102 | @module("rxjs") external combineLatest7: (t<'ca, 'sa, 'a>, t<'cb, 'sb, 'b>, t<'cc, 'sc, 'c>, t<'cd, 'sd, 'd>, t<'ce, 'se, 'e>, t<'cf, 'sf, 'f>, t<'cg, 'sg, 'g>) => t = "combineLatest" 103 | @module("rxjs") @variadic external combineLatestArray: array> => t> = "combineLatest" 104 | 105 | @module("rxjs") @variadic external concatArray: array> => t<'ca, 'sa, 'a> = "concat" 106 | @module("rxjs") external concatAll: (unit) => (. t<'co, 'so, t<'c, 's, 'b>>) => t<'co, 'so, 'b> = "concatAll" 107 | @module("rxjs") external concatMap: ('a => t) => (. t<'c, 's, 'a>) => t<'c, 's, 'b> = "concatMap" 108 | @module("rxjs") external debounce: (t<'ca, 'sa, 'a>) => (. t<'cb, 'sb, 'b>) => t<'cb, 'sb, 'b> = "debounce" 109 | @module("rxjs") external defer: (unit => t<'c, 's, 'a>) => t = "defer" 110 | @module("rxjs") external deferPromise: (unit => Js.Promise.t<'a>) => t = "defer" 111 | @module("rxjs") external delay: (int) => (. t<'c, 's, 'a>) => t<'c, 's, 'a> = "delay" 112 | @module("rxjs") external delayWhen: ('a => t<'cp, 'sp, ()>) => (. t<'c, 's, 'a>) => t<'c, 's, 'a> = "delayWhen" 113 | @module("rxjs") external distinct: (unit) => (. t<'co, 'so, 'a>) => t<'co, 'so, 'a> = "distinct" 114 | @module("rxjs") external distinctUntilChanged: ((. 'a, 'a) => bool) => (. t<'co, 'so, 'a>) => t<'co, 'so, 'a> = "distinctUntilChanged" 115 | 116 | @module("rxjs") external filter: ('a => bool) => (. t<'c, 's, 'a>) => t<'c, 's, 'a> = "filter" 117 | @module("rxjs") external finalize: (() => ()) => (. t<'c, 's, 'a>) => t<'c, 's, 'a> = "finalize" 118 | 119 | // type filter<'a, 'c, 's>> = { 120 | // fn: ('a => bool) => (. t<'c, 's, 'a>) => t<'c, 's, 'a> 121 | // } 122 | // let filter = { fn: filter } 123 | 124 | @module("rxjs") external fromArray: array<'a> => t = "from" 125 | @module("rxjs") external fromPromise: Js.Promise.t<'a> => t = "from" 126 | @module("rxjs") external fromPromiseSched: (Js.Promise.t<'a>, scheduler) => t = "from" 127 | @module("rxjs") external interval: int => t = "interval" 128 | @module("rxjs") external last: (unit) => (. t<'c, 's, 'a>) => t<'c, 's, 'a> = "last" 129 | @module("rxjs") external lastValueFrom: t<'c, 's, 'a> => Js.Promise.t<'a> = "lastValueFrom" 130 | @module("rxjs") external map: (('a, int) => 'b) => ((. t<'c,'s,'a>) => t<'c, 's, 'b>) = "map" 131 | let const: ('b) => (. t<'c, 's, 'a>) => t<'c, 's, 'b> = (b) => map((_, _) => b) 132 | 133 | 134 | @module("rxjs") @variadic external mergeArray: array> => t = "merge" 135 | @module("rxjs") external merge2: (t<'ca, 'sa, 'a>, t<'cb, 'sb, 'a>) => t = "merge" 136 | @module("rxjs") external merge3: (t<'ca, 'sa, 'a>, t<'cb, 'sb, 'a>, t<'cc, 'sc, 'a>) => t = "merge" 137 | @module("rxjs") external merge4: (t<'ca, 'sa, 'a>, t<'cb, 'sb, 'a>, t<'cc, 'sc, 'a>, t<'cd, 'sd, 'a>) => t = "merge" 138 | @module("rxjs") external merge5: (t<'ca, 'sa, 'a>, t<'cb, 'sb, 'a>, t<'cc, 'sc, 'a>, t<'cd, 'sd, 'a>, t<'ce, 'se, 'a>) => t = "merge" 139 | @module("rxjs") external merge6: (t<'ca, 'sa, 'a>, t<'cb, 'sb, 'a>, t<'cc, 'sc, 'a>, t<'cd, 'sd, 'a>, t<'ce, 'se, 'a>, t<'cf, 'sf, 'a>) => t = "merge" 140 | @module("rxjs") external merge7: (t<'ca, 'sa, 'a>, t<'cb, 'sb, 'a>, t<'cc, 'sc, 'a>, t<'cd, 'sd, 'a>, t<'ce, 'se, 'a>, t<'cf, 'sf, 'a>, t<'cg, 'sg, 'a>) => t = "merge" 141 | @module("rxjs") external mergeMap: ('a => t<'cb, 'sb, 'b>) => (. t<'ca, 'sa, 'a>) => t<'ca, 'sa, 'b> = "mergeMap" 142 | 143 | @module("rxjs") external mergeWith2: (t<'ca, 'sa, 'a>) => (. t<'cb, 'sb, 'a>) => t = "mergeWith" 144 | @module("rxjs") external mergeWith3: (t<'ca, 'sa, 'a>, t<'cb, 'sb, 'a>) => (. t<'cc, 'sc, 'a>) => t = "mergeWith" 145 | @module("rxjs") external mergeWith4: (t<'ca, 'sa, 'a>, t<'cb, 'sb, 'a>, t<'cc, 'sc, 'a>) => (. t<'cd, 'sd, 'a>) => t = "mergeWith" 146 | @module("rxjs") external mergeWith5: (t<'ca, 'sa, 'a>, t<'cb, 'sb, 'a>, t<'cc, 'sc, 'a>, t<'cd, 'sd, 'a>) => (. t<'ce, 'se, 'a>) => t = "mergeWith" 147 | @module("rxjs") external mergeWith6: (t<'ca, 'sa, 'a>, t<'cb, 'sb, 'a>, t<'cc, 'sc, 'a>, t<'cd, 'sd, 'a>, t<'ce, 'se, 'a>) => (. t<'cf, 'sf, 'a>) => t = "mergeWith" 148 | @module("rxjs") external mergeWith7: (t<'ca, 'sa, 'a>, t<'cb, 'sb, 'a>, t<'cc, 'sc, 'a>, t<'cd, 'sd, 'a>, t<'ce, 'se, 'a>, t<'cf, 'sf, 'a>) => (. t<'cg, 'sg, 'a>) => t = "mergeWith" 149 | 150 | @module("rxjs") external mergeAll: (unit) => (. t<'ca, 'sa, t<'c, 's, 'b>>) => t<'ca, 'sa, 'b> = "mergeAll" 151 | @module("rxjs") external return: 'a => t = "of" // of is keyword so rename 152 | @module("rxjs") external reduce: ( ('b, 'a, int) => 'b, 'b) => (. t<'ca, 'sa, 'a>) => t<'ca, 'sa, 'b> = "reduce" 153 | @module("rxjs") external scan: ( ('b, 'a, int) => 'b, 'b) => (. t<'ca, 'sa, 'a>) => t<'ca, 'sa, 'b> = "scan" 154 | @module("rxjs") external share: (unit) => (. t<'ca, 'sa, 'a>) => t<'ca, 'sa, 'a> = "share" 155 | @module("rxjs") external shareReplay: (int) => (. t<'ca, 'sa, 'a>) => t<'ca, 'sa, 'a> = "shareReplay" 156 | @module("rxjs") external startWith: ('a) => (.t<'ca, 'sa, 'a>) => t<'ca, 'sa, 'a> = "startWith" 157 | @module("rxjs") external switchMap: ('a => t<'cb, 'sb, 'b>) => (. t<'ca, 'sa, 'a>) => t<'ca, 'sa, 'b> = "switchMap" 158 | @module("rxjs") external take: (int) =>(. t<'ca, 'sa, 'a>) => t<'ca, 'sa, 'a> = "take" 159 | @module("rxjs") external skip: (int) => (. t<'ca, 'sa, 'a>) => t<'ca, 'sa, 'a> = "skip" 160 | @module("rxjs") external tap: ('a => unit) => (. t<'ca, 'sa, 'a>) => t<'ca, 'sa, 'a> = "tap" 161 | @module("rxjs") external tapErrorComplete: ('a => unit, err => unit, unit => unit) => (. t<'ca, 'sa, 'a>) => t<'ca, 'sa, 'a> = "tap" 162 | type timeinterval<'a> = { interval: int, value: 'a } 163 | @module("rxjs") external timeInterval: (unit) => (. t<'ca, 'sa, 'a>) => t<'ca, 'sa, timeinterval<'a>> = "timeInterval" 164 | @module("rxjs") external toArray: (unit) => (. t<'ca, 'sa, 'a>) => t<'ca, 'sa, array<'a>> = "toArray" 165 | @module("rxjs") external withLatestFrom: (t<'ca, 'sa, 'a>) => (. t<'cz, 'sz, 'z>) => t<'cz, 'sz, ('z, 'a)> = "withLatestFrom" 166 | @module("rxjs") external withLatestFrom2: (t<'ca, 'sa, 'a>, t<'cb, 'sb, 'b>) => (. t<'cz, 'sz, 'z>) => t<'cz, 'sz, ('z, 'a, 'b)> = "withLatestFrom" 167 | @module("rxjs") external withLatestFrom3: (t<'ca, 'sa, 'a>, t<'cb, 'sb, 'b>, t<'cc, 'sc, 'c>) => (. t<'cz, 'sz, 'z>) => t<'cz, 'sz, ('z, 'a, 'b, 'c)> = "withLatestFrom" 168 | @module("rxjs") external withLatestFrom4: (t<'ca, 'sa, 'a>, t<'cb, 'sb, 'b>, t<'cc, 'sc, 'c>, t<'cd, 'sd, 'd>) => (. t<'cz, 'sz, 'z>) => t<'cz, 'sz, ('z, 'a, 'b, 'c, 'd)> = "withLatestFrom" 169 | @module("rxjs") external withLatestFrom5: (t<'ca, 'sa, 'a>, t<'cb, 'sb, 'b>, t<'cc, 'sc, 'c>, t<'cd, 'sd, 'd>, t<'ce, 'se, 'e>) => (. t<'cz, 'sz, 'z>) => t<'cz, 'sz, ('z, 'a, 'b, 'c, 'd, 'e)> = "withLatestFrom" 170 | @module("rxjs") external withLatestFrom6: (t<'ca, 'sa, 'a>, t<'cb, 'sb, 'b>, t<'cc, 'sc, 'c>, t<'cd, 'sd, 'd>, t<'ce, 'se, 'e>, t<'cf, 'sf, 'f>) => (. t<'cz, 'sz, 'z>) => t<'cz, 'sz, ('z, 'a, 'b, 'c, 'd, 'e, 'f)> = "withLatestFrom" 171 | @module("rxjs") external withLatestFrom7: (t<'ca, 'sa, 'a>, t<'cb, 'sb, 'b>, t<'cc, 'sc, 'c>, t<'cd, 'sd, 'd>, t<'ce, 'se, 'e>, t<'cf, 'sf, 'f>, t<'cg, 'sg, 'g>) => (. t<'cz, 'sz, 'z>) => t<'cz, 'sz, ('z, 'a, 'b, 'c, 'd, 'e, 'f, 'g)> = "withLatestFrom" 172 | 173 | let keepMap: ('a => option<'b>) => (. t<'ca, 'sa, 'a>) => t<'ca, 'sa, 'b> = (f) => (. xs) => { 174 | xs->pipe3( 175 | map((a, _) => f(a)), 176 | filter(Js.Option.isSome), 177 | map((a, _) => Js.Option.getExn(a)) 178 | ) 179 | } 180 | 181 | let distinctBy = (fn: 'a => 'b) => { 182 | (. source: t<'class, 'source, 'a>): t<'class, 'source, 'a> => { 183 | Observable.make( (observer: Observer.t<'o>) => { 184 | let last = ref(None) 185 | let sub = source->subscribe({ 186 | next: (. x) => { 187 | let fnx = fn(x) 188 | if( Some(fnx) != last.contents) { 189 | last.contents = Some(fnx) 190 | observer.next(. x) 191 | } else { 192 | () 193 | } 194 | }, 195 | error: observer.error, 196 | complete: observer.complete 197 | }) 198 | Some(() => unsubscribe(sub)) 199 | }) 200 | } 201 | } 202 | 203 | -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | rescript@^9.1.4: 6 | version "9.1.4" 7 | resolved "https://registry.yarnpkg.com/rescript/-/rescript-9.1.4.tgz#1eb126f98d6c16942c0bf0df67c050198e580515" 8 | integrity sha512-aXANK4IqecJzdnDpJUsU6pxMViCR5ogAxzuqS0mOr8TloMnzAjJFu63fjD6LCkWrKAhlMkFFzQvVQYaAaVkFXw== 9 | 10 | rxjs@^6.6.7: 11 | version "6.6.7" 12 | resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" 13 | integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== 14 | dependencies: 15 | tslib "^1.9.0" 16 | 17 | tslib@^1.9.0: 18 | version "1.14.1" 19 | resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" 20 | integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== 21 | --------------------------------------------------------------------------------