cytoplasmic
    Preparing search index...

    Function Unwrap

    • Unwrap a cell. The DOM is rebuilt whenever the input cell changes. If the cell value is null or undefined the else-branch will be rendered instead (similar to Deref).

      Type Parameters

      • T

      Parameters

      • props: {
            children: (value: T) => ElementChildren;
            else?: ElementChildren;
            from: Cell<undefined | null | T>;
        }
        • children: (value: T) => ElementChildren

          A function that accepts the unwrapped value and returns an element

        • Optionalelse?: ElementChildren

          Optional element to render if the cell value is null or undefined.

        • from: Cell<undefined | null | T>

          The cell to unwrap.

      Returns Element

      const num = bind(5);

      <Unwrap from={num}>{ num =>
      {num + 5} is ten
      }</Unwrap>