MCPcopy Create free account
hub / github.com/contentlayerdev/contentlayer / getUpdateEvents

Function getUpdateEvents

packages/archive/source-sanity/src/index.ts:39–51  ·  view source on GitHub ↗
(studioDirPath: string)

Source from the content-addressed store, hash-verified

37}
38
39const getUpdateEvents = (studioDirPath: string): Observable<any> =>
40 defer(() => getSanityClient(studioDirPath)).pipe(
41 mergeMap(
42 (sanityClient) =>
43 // TOOD Observable wrapping can be removed once RXJS in sanity is updated to v7
44 new Observable((subscriber) => {
45 // `visibility: 'query'` needed otherwise event will trigger too early
46 sanityClient
47 .listen<MutationEvent>('*', {}, { events: ['mutation'], visibility: 'query' })
48 .subscribe(subscriber)
49 }),
50 ),
51 )

Callers 1

makeSourcePluginFunction · 0.85

Calls 2

getSanityClientFunction · 0.85
subscribeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…