summaryrefslogtreecommitdiff
path: root/js/dispatch.ts
diff options
context:
space:
mode:
authorJonathon Orsi <jonathon.orsi@gmail.com>2019-04-07 20:51:43 -0400
committerRyan Dahl <ry@tinyclouds.org>2019-04-07 20:51:43 -0400
commit3452a10840ef47bb5546969ebe776289c7b095f1 (patch)
tree165439d870c7fdc2b914d9e008162ea7c17b4cb2 /js/dispatch.ts
parent86aee7f13751bd4707f6c2fe367be2359fde84b2 (diff)
use flatbuffer create functions to add fields (#2046)
Diffstat (limited to 'js/dispatch.ts')
-rw-r--r--js/dispatch.ts16
1 files changed, 10 insertions, 6 deletions
diff --git a/js/dispatch.ts b/js/dispatch.ts
index 528cf320c..d5e10ad09 100644
--- a/js/dispatch.ts
+++ b/js/dispatch.ts
@@ -31,12 +31,16 @@ function sendInternal(
sync = true
): [number, null | Uint8Array] {
const cmdId = nextCmdId++;
- msg.Base.startBase(builder);
- msg.Base.addInner(builder, inner);
- msg.Base.addInnerType(builder, innerType);
- msg.Base.addSync(builder, sync);
- msg.Base.addCmdId(builder, cmdId);
- builder.finish(msg.Base.endBase(builder));
+ const message = msg.Base.createBase(
+ builder,
+ cmdId,
+ sync,
+ 0,
+ 0,
+ innerType,
+ inner
+ );
+ builder.finish(message);
const control = builder.asUint8Array();
const response = core.dispatch(control, zeroCopy);