Skip to content

Reactive

Inherits: LibTSMModule

Functions

CreateStateSchema

lua
function Reactive.CreateStateSchema(name)
  -> ReactiveStateSchema

Creates a new state schema object.

Parameters:

NameTypeDescription
namestringThe name for debugging purposes

Returns:

TypeDescription
ReactiveStateSchema

GetOneShotPublisher

lua
function Reactive.GetOneShotPublisher(value, autoDisable, autoStore)
  -> ReactivePublisherSchema

Gets a publisher which publishes a single initial value and never again.

Parameters:

NameTypeDescription
valueTThe value to publish
autoDisablebooleanWhether or not to automatically disable the publisher
autoStoretableThe table to store the publisher in automatically

Returns:

TypeDescription
ReactivePublisherSchema

GetStream

lua
function Reactive.GetStream(initialValueFunc)
  -> ReactiveStream

Gets a stream object.

Parameters:

NameTypeDescription
initialValueFuncfun(): TA function to get the initial value to send to new publishers

Returns:

TypeDescription
ReactiveStream