Refactored bridge to support transferrables (e.g. typed array buffers) and added transferable param to postMessage for op codes

This commit is contained in:
Brian Vaughn
2019-01-29 13:17:37 -08:00
parent 3f93b029a4
commit fdfadef928
10 changed files with 30 additions and 41 deletions
+5
View File
@@ -102,6 +102,11 @@ export default class Store extends EventEmitter {
}
onBridgeOperations = (operations: Uint32Array) => {
if (!(operations instanceof Uint32Array)) {
// $FlowFixMe TODO HACK Temporary workaround for the fact that Chrome is not transferring the typed array.
operations = Uint32Array.from(Object.values(operations));
}
debug('onBridgeOperations', operations);
let haveRootsChanged = false;