Interface Projector

Hierarchy

Methods

  • Appends a new child node to the DOM using the result from the provided renderFunction. The renderFunction will be invoked again to update the DOM when needed.

    Parameters

    • parentNode: Element

      The parent node for the new child node.

    • renderFunction: (() => VNode)

      Function with zero arguments that returns a [[VNode]] tree.

    Returns void

  • Stops running the renderFunction to update the DOM. The renderFunction must have been registered using [[append]], [[merge]], [[insertBefore]] or [[replace]].

    Returns

    The [[Projection]] which was created using this renderFunction. The [[Projection]] contains a reference to the DOM Node that was rendered.

    Parameters

    Returns Projection

  • Inserts a new DOM node using the result from the provided renderFunction. The renderFunction will be invoked again to update the DOM when needed.

    Parameters

    • beforeNode: Element

      The node that the DOM Node is inserted before.

    • renderFunction: (() => VNode)

      Function with zero arguments that returns a [[VNode]] tree.

    Returns void

  • Merges a new DOM node using the result from the provided renderFunction with an existing DOM Node. This means that the virtual DOM and real DOM have one overlapping element. Therefore the selector for the root [[VNode]] will be ignored, but its properties and children will be applied to the Element provided The renderFunction will be invoked again to update the DOM when needed.

    Parameters

    • domNode: Element

      The existing element to adopt as the root of the new virtual DOM. Existing attributes and child nodes are preserved.

    • renderFunction: (() => VNode)

      Function with zero arguments that returns a [[VNode]] tree.

    Returns void

  • Synchronously re-renders to the DOM. You should normally call the scheduleRender() function to keep the user interface more performant. There is however one good reason to call renderNow(), when you want to put the focus into a newly created element in iOS. This is only allowed when triggered by a user-event, not during requestAnimationFrame.

    Returns void

  • Replaces an existing DOM node with the result from the provided renderFunction. The renderFunction will be invoked again to update the DOM when needed.

    Parameters

    • domNode: Element

      The DOM node to replace.

    • renderFunction: (() => VNode)

      Function with zero arguments that returns a [[VNode]] tree.

    Returns void

  • Resumes the projector. Use this method to resume rendering after [[stop]] was called or an error occurred during rendering.

    Returns void

  • Instructs the projector to re-render to the DOM at the next animation-frame using the registered render functions. This method is automatically called for you when event-handlers that are registered in the [[VNode]]s are invoked.

    You need to call this method when timeouts expire, when AJAX responses arrive or other asynchronous actions happen.

    Returns void

  • Stops the projector. This means that the registered render functions will not be called anymore.

    Note that calling [[stop]] is not mandatory. A projector is a passive object that will get garbage collected as usual if it is no longer in scope.

    Returns void

Generated using TypeDoc