UNPKG

async-array-buffer

Version:

This module allows to allocate and deallocate ArrayBuffers without blocking the main thread.

12 lines 592 B
import { load } from 'async-array-buffer-broker'; import { worker } from './worker/worker'; const blob = new Blob([worker], { type: 'application/javascript; charset=utf-8' }); const url = URL.createObjectURL(blob); const asyncArrayBuffer = load(url); export const allocate = asyncArrayBuffer.allocate; export const connect = asyncArrayBuffer.connect; export const deallocate = asyncArrayBuffer.deallocate; export const disconnect = asyncArrayBuffer.disconnect; export const isSupported = asyncArrayBuffer.isSupported; URL.revokeObjectURL(url); //# sourceMappingURL=/build/es2018/module.js.map