signal-polyfill
Version:
A polyfill for the TC39 Signal proposal.
13 lines (11 loc) • 366 B
text/typescript
import {describe, expect, it} from 'vitest';
import {Signal} from '../../../src/wrapper.js';
describe('currentComputed', () => {
it('works', () => {
expect(Signal.subtle.currentComputed()).toBe(undefined);
let context;
let c = new Signal.Computed(() => (context = Signal.subtle.currentComputed()));
c.get();
expect(c).toBe(context);
});
});