Home Reference Source
import ForeignChildInteractor from '~/interactors/ForeignChildInteractor.js'
public class | source

ForeignChildInteractor

Interacts with a ForeignInteractor as a parent.

Constructor Summary

Public Constructor
public

constructor(instanceId: string, tickTimeout: number)

Creates a ForeignChildInteractor based of a primary interactor.

Method Summary

Public Methods
public

getDelta(key: strin)

Obtains the last write delta.

public

queueTick(time: number)

Queues an async tick

public

tick()

Performs update.

public

watch(key: string, callback: Function)

Watches a key w/ a registered callback

public

watchTick(callback: Function)

Called on a new tick

Public Constructors

public constructor(instanceId: string, tickTimeout: number) source

Creates a ForeignChildInteractor based of a primary interactor.

Params:

NameTypeAttributeDescription
instanceId string

Id from a ForeignIntercator. Undefined behavior if not valid

tickTimeout number
  • optional
  • default: 5

A minimum refresh time delta. Will not update intermediates until delta has expired.

Public Methods

public getDelta(key: strin) source

Obtains the last write delta.

Params:

NameTypeAttributeDescription
key strin

key to get delta for

public queueTick(time: number) source

Queues an async tick

Params:

NameTypeAttributeDescription
time number

Time to issue next tick

public tick() source

Performs update. Automatically managed.

public watch(key: string, callback: Function) source

Watches a key w/ a registered callback

Params:

NameTypeAttributeDescription
key string

The key of the value to watch

callback Function

The callback is called with the value.

public watchTick(callback: Function) source

Called on a new tick

Params:

NameTypeAttributeDescription
callback Function

The callbackl