This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type Inputs<Elements> = { | |
| [Key in keyof Elements]: readonly Elements[Key][]; | |
| }; | |
| declare function combine<Elements extends unknown[]>( | |
| ...inputs: [...Inputs<Elements>] | |
| ): Elements[number][]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const result = combine(["a", "b"], [1, 2]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Exported variable 'read' has or is using private name 'ReadCallback'. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const read = (() => { | |
| interface ReadCallback { | |
| (content: string): string; | |
| } | |
| return function (path: string, callback: ReadCallback) {}; | |
| })(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| declare const read: ( | |
| path: string, | |
| callback: (content: string) => string | |
| ) => void; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const read = (() => { | |
| type ReadCallback = (content: string) => string; | |
| return function (path: string, callback: ReadCallback) {}; | |
| })(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| declare type ReadCallback = (content: string) => string; | |
| declare function read(path: string, callback: ReadCallback): void; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type ReadCallback = (content: string) => string; | |
| function read(path: string, callback: ReadCallback) {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { config } from "rxjs"; | |
| config.onStoppedNotification = (notification) => { | |
| switch (notification.kind) { | |
| case "E": | |
| const error: any = new Error( | |
| "Cannot notify stopped observer" | |
| ); | |
| error.notification = notification; | |
| throw error; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { concat, NEVER, Observable, OperatorFunction } from "rxjs"; | |
| import { buffer, mergeAll, publish, take } from "rxjs/operators"; | |
| function delayUntil<T>(notifier: Observable<any>): OperatorFunction<T, T> { | |
| return source => | |
| source.pipe( | |
| publish(published => | |
| concat( | |
| concat(published, NEVER).pipe(buffer(notifier), take(1), mergeAll()), | |
| published |