summaryrefslogtreecommitdiff
path: root/fetch.ts
diff options
context:
space:
mode:
Diffstat (limited to 'fetch.ts')
-rw-r--r--fetch.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/fetch.ts b/fetch.ts
index e0ac4db71..42acfa22f 100644
--- a/fetch.ts
+++ b/fetch.ts
@@ -2,11 +2,11 @@
// All rights reserved. MIT License.
import { assert, log, createResolvable, Resolvable } from "./util";
import * as util from "./util";
-import * as dispatch from "./dispatch";
+import { pubInternal, sub } from "./dispatch";
import { main as pb } from "./msg.pb";
export function initFetch() {
- dispatch.sub("fetch", (payload: Uint8Array) => {
+ sub("fetch", (payload: Uint8Array) => {
const msg = pb.Msg.decode(payload);
assert(msg.command === pb.Msg.Command.FETCH_RES);
const id = msg.fetchResId;
@@ -111,7 +111,7 @@ class FetchRequest {
start() {
log("dispatch FETCH_REQ", this.id, this.url);
- const res = dispatch.sendMsg("fetch", {
+ const res = pubInternal("fetch", {
command: pb.Msg.Command.FETCH_REQ,
fetchReqId: this.id,
fetchReqUrl: this.url