File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,7 +9,13 @@ import { Parser } from "./parallel_parser.ts";
99// deno-lint-ignore require-yield
1010async function * errorOnly ( promise : Promise < never > ) : AsyncGenerator < never > {
1111 await promise ;
12- unreachable ( ) ;
12+ }
13+ async function * addOneBefore < T > (
14+ first : T ,
15+ iterable : AsyncIterable < T > ,
16+ ) : AsyncGenerator < T > {
17+ yield first ;
18+ yield * iterable ;
1319}
1420if ( import . meta. main ) {
1521 using watcher = Deno . watchFs ( "./dictionary.txt" ) ;
@@ -29,12 +35,10 @@ if (import.meta.main) {
2935 } ) ;
3036 } , 200 ) ;
3137
32- const watcherWithError = new MuxAsyncIterator < Deno . FsEvent > ( ) ;
33- watcherWithError . add ( watcher ) ;
38+ const watcherWithError = new MuxAsyncIterator < null | Deno . FsEvent > ( ) ;
39+ watcherWithError . add ( addOneBefore ( null , watcher ) ) ;
3440 watcherWithError . add ( errorGenerator ) ;
3541
36- buildDebounced ( ) ;
37- buildDebounced . flush ( ) ;
3842 for await ( const _ of watcherWithError ) {
3943 buildDebounced ( ) ;
4044 }
You can’t perform that action at this time.
0 commit comments