UNPKG

comctx

Version:

Cross-context RPC solution with type safety and flexible adapters.

16 lines (12 loc) 352 B
import { provideCounter } from '@/shared' import { defineBackground } from 'wxt/sandbox' import ProvideAdapter from './ProvideAdapter' export default defineBackground({ type: 'module', main() { const counter = provideCounter(new ProvideAdapter()) counter.onChange((value) => { console.log('Background Value:', value) }) } })