MCPcopy
hub / github.com/tldraw/tldraw / constructor

Method constructor

packages/sync-core/src/test/syncFuzz.test.ts:69–101  ·  view source on GitHub ↗
(
		public readonly seed: number,
		server: TestServer<TLRecord>
	)

Source from the content-addressed store, hash-verified

67 hasLoaded = false
68
69 constructor(
70 public readonly seed: number,
71 server: TestServer<TLRecord>
72 ) {
73 super(seed)
74
75 this.id = uniqueId()
76 this.store = createTLStore({ schema, id: this.id })
77 this.socketPair = new TestSocketPair(this.id, server)
78 this.client = new TLSyncClient<TLRecord>({
79 store: this.store,
80 socket: this.socketPair.clientSocket,
81 onSyncError: (reason) => {
82 throw new Error('onSyncError:' + reason)
83 },
84 onLoad: () => {
85 this.editor = new FuzzEditor(this.id, this.seed, this.store)
86 },
87 presence: createPresenceStateDerivation(
88 computed('', () =>
89 UserRecordType.create({
90 id: createUserId(this.id),
91 name: 'test',
92 color: 'red',
93 })
94 )
95 )(this.store),
96 })
97
98 disposables.push(() => {
99 this.client.close()
100 })
101 }
102}
103
104function assertPeerStoreIsUsable(peer: FuzzTestInstance) {

Callers

nothing calls this directly

Calls 8

uniqueIdFunction · 0.85
createTLStoreFunction · 0.85
computedFunction · 0.85
createUserIdFunction · 0.85
createMethod · 0.65
closeMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected