x/evt/test/test54.ts
1234567891011121314151617181920import { Evt } from "../lib/index.ts";import { assert } from "https://deno.land/x/tsafe@v1.3.4/assert.ts";const evtText = new Evt<string>();const text = "ok";evtText.evtAttach.attach( ({ op })=> evtText.isHandledByOp(op, text), () => evtText.post(text));let str = "";evtText.attachOnce(str_ => str = str_);assert(str === "ok");console.log("PASS");