MCPcopy Create free account
hub / github.com/Effect-TS/effect / encodeProps

Function encodeProps

packages/effect/src/ui/internal/serialize.ts:212–230  ·  view source on GitHub ↗
(
  inst: Kernel.Instance,
  props: unknown,
  ctx: Context.Context<any>
)

Source from the content-addressed store, hash-verified

210
211/** @internal */
212export const encodeProps = (
213 inst: Kernel.Instance,
214 props: unknown,
215 ctx: Context.Context<any>
216): Effect.Effect<unknown> =>
217 Effect.catchCause(
218 encodeJson((inst.component as unknown as Component.Any).props, props),
219 (cause) => {
220 warnOnce(
221 "props",
222 inst,
223 ctx,
224 () =>
225 "its props don't encode as JSON, so the server leaves them out of the state and " +
226 "HtmlHydrate.decodeProps fails on the client. " + formatCause(cause)
227 )
228 return Effect.undefined
229 }
230 )
231
232const ignore = () => {}
233const mute: services.ServerSink = {

Callers

nothing calls this directly

Calls 3

encodeJsonFunction · 0.90
warnOnceFunction · 0.90
formatCauseFunction · 0.90

Tested by

no test coverage detected