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

Function encode

packages/effect/src/ui/MessageLog.ts:1580–1795  ·  view source on GitHub ↗
(entry)

Source from the content-addressed store, hash-verified

1578 })
1579 return {
1580 encode(entry) {
1581 switch (entry._tag) {
1582 case "SessionStarted":
1583 return { _tag: "SessionStarted", ...base(entry), app: entry.app }
1584 case "FetchStarted":
1585 return {
1586 _tag: "FetchStarted",
1587 ...base(entry),
1588 query: entry.query,
1589 logKey: entry.logKey,
1590 trigger: entry.trigger,
1591 restart: entry.restart,
1592 inWindow: entry.inWindow,
1593 stored: entry.stored,
1594 empty: entry.empty,
1595 ...(entry.watcher === undefined
1596 ? undefined
1597 : { watcher: entry.watcher }),
1598 ...(entry.page === undefined ? undefined : { page: entry.page }),
1599 ...(entry.cursor === undefined
1600 ? undefined
1601 : { cursor: entry.cursor }),
1602 ...(entry.traceId === undefined
1603 ? undefined
1604 : { traceId: entry.traceId }),
1605 ...(entry.parentSpanId === undefined
1606 ? undefined
1607 : { parentSpanId: entry.parentSpanId })
1608 }
1609 case "Waiting":
1610 return {
1611 _tag: "Waiting",
1612 ...instanceBase(entry),
1613 props: props(entry),
1614 model: capped(entry.component, "model", entry.model),
1615 ...encodeQueries(entry.component, entry.queries),
1616 ...boundaryOf(entry)
1617 }
1618 case "Mounted":
1619 return {
1620 _tag: "Mounted",
1621 ...instanceBase(entry),
1622 props: props(entry),
1623 model: capped(entry.component, "model", entry.model),
1624 ...encodeQueries(entry.component, entry.queries),
1625 commands: entry.commands.map(encodeCommand),
1626 events: events(entry),
1627 adopted: entry.adopted,
1628 ...boundaryOf(entry)
1629 }
1630 case "Update":
1631 return {
1632 _tag: "Update",
1633 ...instanceBase(entry),
1634 source: encodeSource(entry.source),
1635 message: capped(entry.component, "message", entry.message),
1636 props: props(entry),
1637 model: capped(entry.component, "model", entry.model),

Callers 7

encodeWithFunction · 0.70
encodeAtFunction · 0.70
makeGroupFunction · 0.70
materializedEncodingFunction · 0.70
argsEncoderFunction · 0.70
argsKeyFunction · 0.70
logKeyFunction · 0.70

Calls 15

instanceBaseFunction · 0.85
cappedFunction · 0.85
encodeQueriesFunction · 0.85
encodeSourceFunction · 0.85
encodeSharedFunction · 0.85
encodeCollectedFunction · 0.85
encodeSendFunction · 0.85
capFunction · 0.85
encodeWithFunction · 0.85
encodeCauseFunction · 0.85
encodeArgsFunction · 0.85
encodeSubscriptionFunction · 0.85

Tested by

no test coverage detected