deno.land / x / xstate@xstate@4.33.6 / src / registry.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { Actor } from './Actor';
const children = new Map<string, Actor>();
let sessionIdIndex = 0;
export interface Registry { bookId(): string; register(id: string, actor: Actor): string; get(id: string): Actor | undefined; free(id: string): void;}
export const registry: Registry = { bookId() { return `x:${sessionIdIndex++}`; }, register(id, actor) { children.set(id, actor); return id; }, get(id) { return children.get(id); }, free(id) { children.delete(id); }};
xstate

Version Info

Tagged at
2 years ago