How to use the comlink.proxyValue function in comlink

To help you get started, we’ve selected a few comlink examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fluid-notion / fluid-outliner / core / models / Repository.ts View on Github external
public onUnload(lambda: Lambda) {
        this.subscribers.onUnload.push(lambda)
        return Comlink.proxyValue(() => pull(this.subscribers.onUnload, lambda))
    }
github fluid-notion / fluid-outliner / core / models / Repository.ts View on Github external
public async getOutlineShellProxy() {
        if (this.outlineShell) return Comlink.proxyValue(this.outlineShell)
        return null
    }
github fluid-notion / fluid-outliner / core / models / Repository.ts View on Github external
public onUpdate(lambda: Lambda) {
        this.subscribers.onUpdate.push(lambda)
        return Comlink.proxyValue(() => pull(this.subscribers.onUpdate, lambda))
    }
github fluid-notion / fluid-outliner / core / models / OutlineShell.ts View on Github external
public onChange(subscriber: OutlineChangeSubscriber) {
        this.subscribers.push(subscriber)
        return Comlink.proxyValue(() => pull(this.subscribers, subscriber))
    }
github fluid-notion / fluid-outliner / core / models / Repository.ts View on Github external
public onLoad(lambda: Lambda) {
        this.subscribers.onLoad.push(lambda)
        if (this.outline) {
            this.invokeSubscribers("onLoad")
        }
        return Comlink.proxyValue(() => pull(this.subscribers.onLoad, lambda))
    }
github fluid-notion / fluid-outliner / core / models / Repository.ts View on Github external
public async getOutlineVisitState() {
        if (this.outlineVisitState) return Comlink.proxyValue(this.outlineVisitState)
        return null
    }

comlink

Comlink makes WebWorkers enjoyable

Apache-2.0
Latest version published 2 months ago

Package Health Score

92 / 100
Full package analysis

Similar packages