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

Function createNoOpStorageEventApi

packages/db/src/local-storage.ts:220–229  ·  view source on GitHub ↗

* Creates a no-op storage event API for environments without window (e.g., server-side) * This provides the required interface but doesn't actually listen to any events * since cross-tab synchronization is not possible in server environments * @returns An object implementing the StorageEventApi i

()

Source from the content-addressed store, hash-verified

218 * @returns An object implementing the StorageEventApi interface with no-op methods
219 */
220function createNoOpStorageEventApi(): StorageEventApi {
221 return {
222 addEventListener: () => {
223 // No-op: cannot listen to storage events without window
224 },
225 removeEventListener: () => {
226 // No-op: cannot remove listeners without window
227 },
228 }
229}
230
231/**
232 * Creates localStorage collection options for use with a standard Collection

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected