MCPcopy Create free account
hub / github.com/dailydotdev/apps / toValue

Function toValue

packages/shared/src/features/feedExplain/useWhatsOffChange.ts:74–82  ·  view source on GitHub ↗
(
  control: FeedControl<Mode> | undefined,
)

Source from the content-addressed store, hash-verified

72
73// The control as it was, to undo to: its level or exact weight, or Auto.
74const toValue = <Mode>(
75 control: FeedControl<Mode> | undefined,
76): ControlValue<Mode> =>
77 control
78 ? {
79 mode: control.mode,
80 ...(control.weight !== null && { weight: control.weight }),
81 }
82 : { mode: null };
83
84export interface AppliedWhatsOffChange {
85 /** Takes the change back to how things were, where that can be done. */

Callers 1

getLevelUndoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected