Skip to content

Commit

Permalink
Rename sendMsgFromObject to sendMsg
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed May 23, 2018
1 parent 602ee0d commit be48837
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
5 changes: 1 addition & 4 deletions dispatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ export function pub(channel: string, payload: Uint8Array): null | ArrayBuffer {
// Internal version of "pub".
// TODO add internal version of "sub"
// TODO rename to pubInternal()
export function sendMsgFromObject(
channel: string,
obj: pb.IMsg
): null | pb.Msg {
export function sendMsg(channel: string, obj: pb.IMsg): null | pb.Msg {
const msg = pb.Msg.fromObject(obj);
const ui8 = pb.Msg.encode(msg).finish();
const resBuf = pub(channel, ui8);
Expand Down
8 changes: 4 additions & 4 deletions os.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { ModuleInfo } from "./types";
import { sendMsgFromObject } from "./dispatch";
import { sendMsg } from "./dispatch";

export function exit(code = 0): void {
sendMsgFromObject("os", { exit: { code } });
sendMsg("os", { exit: { code } });
}

export function sourceCodeFetch(
moduleSpecifier: string,
containingFile: string
): ModuleInfo {
const res = sendMsgFromObject("os", {
const res = sendMsg("os", {
sourceCodeFetch: { moduleSpecifier, containingFile }
});
return res.sourceCodeFetchRes;
Expand All @@ -20,7 +20,7 @@ export function sourceCodeCache(
sourceCode: string,
outputCode: string
): void {
sendMsgFromObject("os", {
sendMsg("os", {
sourceCodeCache: { filename, sourceCode, outputCode }
});
}
2 changes: 1 addition & 1 deletion timers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function setTimeout(cb: TimerCallback, duration: number): number {
cb
};
timers.set(timer.id, timer);
dispatch.sendMsgFromObject("timers", {
dispatch.sendMsg("timers", {
timerStart: {
id: timer.id,
interval: false,
Expand Down

0 comments on commit be48837

Please sign in to comment.