mirror of
https://codeberg.org/valpackett/tiddlypwa.git
synced 2025-12-06 02:30:48 -08:00
Update deno (fix stream callback type)
This commit is contained in:
parent
9b9f97a646
commit
9d27e2c357
2 changed files with 8 additions and 6 deletions
|
|
@ -73,7 +73,10 @@ function notifyMonitors(token: string, browserToken: string) {
|
|||
// chan.close(); // -> Uncaught (in promise) BadResource: Bad resource ID ?!
|
||||
}
|
||||
|
||||
function streamsponse(start: ReadableStreamDefaultControllerCallback<string>, init: ResponseInit | undefined) {
|
||||
// ReadableStreamDefaultControllerCallback is deprecated
|
||||
type CtrlCb<R> = (controller: ReadableStreamDefaultController<R>) => void | PromiseLike<void>;
|
||||
|
||||
function streamsponse(start: CtrlCb<string>, init: ResponseInit | undefined) {
|
||||
return new Response(new ReadableStream({ start }).pipeThrough(new TextEncoderStream()), init);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue