MCPcopy Create free account
hub / github.com/LeetCode-OpenSource/ayanami / SSREffectOptions

Interface SSREffectOptions

src/ssr/express.ts:23–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21}
22
23interface SSREffectOptions<Payload> {
24 /**
25 * Function used to get effect payload.
26 *
27 * if SKIP_SYMBOL returned(`return skip()`), effect won't get dispatched when SSR
28 *
29 * @param req express request object
30 * @param skip get a symbol used to let effect escape from ssr effects dispatching
31 */
32 payloadGetter?: (
33 req: Request,
34 skip: () => typeof SKIP_SYMBOL,
35 ) => Payload | Promise<Payload> | typeof SKIP_SYMBOL
36
37 /**
38 * Whether skip first effect dispatching in client if effect ever got dispatched when SSR
39 *
40 * @default true
41 */
42 skipFirstClientDispatch?: boolean
43}
44
45// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
46export function SSREffect<T, Payload>(options?: SSREffectOptions<Payload>) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected