MCPcopy Create free account
hub / github.com/TanStack/db / emitStatusChange

Method emitStatusChange

packages/db/src/collection/events.ts:145–164  ·  view source on GitHub ↗
(
    status: T,
    previousStatus: CollectionStatus,
  )

Source from the content-addressed store, hash-verified

143 }
144
145 emitStatusChange<T extends CollectionStatus>(
146 status: T,
147 previousStatus: CollectionStatus,
148 ) {
149 this.emit(`status:change`, {
150 type: `status:change`,
151 collection: this.collection,
152 previousStatus,
153 status,
154 })
155
156 // Emit specific status event using type assertion
157 const eventKey: `status:${T}` = `status:${status}`
158 this.emit(eventKey, {
159 type: eventKey,
160 collection: this.collection,
161 previousStatus,
162 status,
163 } as AllCollectionEvents[`status:${T}`])
164 }
165
166 emitSubscribersChange(
167 subscriberCount: number,

Callers 1

setStatusMethod · 0.80

Calls 1

emitMethod · 0.95

Tested by

no test coverage detected