@arcmantle/adapter-element
    Preparing search index...

    Function when

    • When condition is true, returns the result of calling trueCase(), else returns the result of calling falseCase() if falseCase is defined.

      This is a convenience wrapper around a ternary expression that makes it a little nicer to write an inline conditional without an else.

      Type Parameters

      • C extends Falsy
      • T
      • F = undefined

      Parameters

      • condition: C
      • trueCase: (c: C) => T
      • OptionalfalseCase: (c: C) => F

      Returns F

      render() {
      return html`
      ${when(this.user, () => html`User: ${this.user.username}`, () => html`Sign In...`)}
      `;
      }
    • When condition is true, returns the result of calling trueCase(), else returns the result of calling falseCase() if falseCase is defined.

      This is a convenience wrapper around a ternary expression that makes it a little nicer to write an inline conditional without an else.

      Type Parameters

      • C
      • T
      • F

      Parameters

      • condition: C extends Falsy ? never : C
      • trueCase: (c: C) => T
      • OptionalfalseCase: (c: C) => F

      Returns T

      render() {
      return html`
      ${when(this.user, () => html`User: ${this.user.username}`, () => html`Sign In...`)}
      `;
      }
    • When condition is true, returns the result of calling trueCase(), else returns the result of calling falseCase() if falseCase is defined.

      This is a convenience wrapper around a ternary expression that makes it a little nicer to write an inline conditional without an else.

      Type Parameters

      • C
      • T
      • F = undefined

      Parameters

      • condition: C
      • trueCase: (c: Exclude<C, Falsy>) => T
      • OptionalfalseCase: (c: Extract<C, Falsy>) => F

      Returns C extends Falsy ? F : T

      render() {
      return html`
      ${when(this.user, () => html`User: ${this.user.username}`, () => html`Sign In...`)}
      `;
      }