Skip to content

Commit 64f0480

Browse files
committed
test: update
1 parent a776ace commit 64f0480

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

packages/native/src/__tests__/types/types.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,21 @@ describe("types", () => {
158158
]
159159
})
160160

161+
test("通用监听器类型传递", () => {
162+
163+
const emitter = new FastEvent();
164+
type MyListener<
165+
P = any,
166+
M extends Record<string, any> = Record<string, any>,
167+
T extends string = string
168+
> = FastEventListener<P, M, T>
169+
const listener: MyListener = (message) => {
170+
console.log(message)
171+
}
172+
emitter.on("xxx", listener)
173+
})
174+
175+
161176
})
162177

163178

0 commit comments

Comments
 (0)