Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Projector

Hierarchy

Index

Methods

append

  • append(parentNode: Element, renderFunction: function): void
  • 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: function

      Function with zero arguments that returns a VNode tree.

    Returns void

detach

insertBefore

  • insertBefore(beforeNode: Element, renderFunction: function): void
  • 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: function

      Function with zero arguments that returns a VNode tree.

    Returns void

merge

  • merge(domNode: Element, renderFunction: function): 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: function

      Function with zero arguments that returns a VNode tree.

    Returns void

renderNow

  • renderNow(): 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

replace

  • replace(domNode: Element, renderFunction: function): 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: function

      Function with zero arguments that returns a VNode tree.

    Returns void

resume

  • resume(): void
  • Resumes the projector. Use this method to resume rendering after stop was called or an error occurred during rendering.

    Returns void

scheduleRender

  • scheduleRender(): 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 VNodes are invoked.

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

    Returns void

stop

  • stop(): 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