Stone.js API
    Preparing search index...

    The runtime a component reaches for on a phone.

    Registered under the same reactRuntime alias the web runtime uses, so a service or a component that asks for the runtime gets the one belonging to the platform it is running on. Same three abilities, each meaning what it can mean natively: remember a value across a render, set the screen's title, and show an error page.

    Index
    • Apply a head context.

      A phone has no document, so most of a head has nowhere to go. The title does: it is the screen's title, which a navigator shows in its header.

      Parameters

      • value: HeadContext

        The head context to apply.

      Returns void

    • Remember a value for the current event.

      The web runtime uses this to carry state from a server render into hydration. There is no server here, so it is a per-event cache: asked twice for the same key during one navigation, the handler runs once.

      Type Parameters

      • T

      Parameters

      • key: string

        The key to store the value under.

      • handler: (container?: IContainer) => Promiseable<T>

        Produces the value when it is not already known.

      Returns Promise<T>

      The value.

    • Show an error page for an error raised while rendering.

      Parameters

      • error: any

        The error to show.

      • statusCode: number = 500

        The status to render it with.

      Returns Promise<void>

      The original error when the application declared no error page for it.

    • The booted runtime, for code that runs outside the container: a screen, the native entry.

      Returns NativeRuntime

      The runtime, once the application has booted.

    • Share the booted runtime. Called by the provider that booted it, and by nothing else.

      Parameters

      Returns void