2023-04-03 12:48:02 -07:00

17 lines
325 B
TypeScript

import Decoder from "./decoder"
let decoder: Decoder
self.addEventListener('message', (e: MessageEvent) => {
if (e.data.config) {
decoder = new Decoder(e.data.config)
}
if (e.data.init) {
decoder.init(e.data.init)
}
if (e.data.segment) {
decoder.decode(e.data.segment)
}
})