mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-16 13:57:02 +08:00
chore: remove unused methods on slot (#9472)
This commit is contained in:
@@ -43,16 +43,4 @@ describe('slot', () => {
|
||||
slot.emit();
|
||||
expect(callback).toBeCalledTimes(0);
|
||||
});
|
||||
|
||||
test('subscribe', () => {
|
||||
type Data = {
|
||||
name: string;
|
||||
age: number;
|
||||
};
|
||||
const slot = new Slot<Data>();
|
||||
const callback = vi.fn(v => expect(v).toBe('田所'));
|
||||
slot.subscribe(v => v.name, callback);
|
||||
slot.emit({ name: '田所', age: 24 });
|
||||
expect(callback).toBeCalledTimes(1);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user