Appearance
Reactive
Inherits: LibTSMModule
Functions
CreateStateSchema
lua
function Reactive.CreateStateSchema(name)
-> ReactiveStateSchemaCreates a new state schema object.
Parameters:
| Name | Type | Description |
|---|---|---|
name | string | The name for debugging purposes |
Returns:
| Type | Description |
|---|---|
ReactiveStateSchema |
GetOneShotPublisher
lua
function Reactive.GetOneShotPublisher(value, autoDisable, autoStore)
-> ReactivePublisherSchemaGets a publisher which publishes a single initial value and never again.
Parameters:
| Name | Type | Description |
|---|---|---|
value | T | The value to publish |
autoDisable | boolean | Whether or not to automatically disable the publisher |
autoStore | table | The table to store the publisher in automatically |
Returns:
| Type | Description |
|---|---|
ReactivePublisherSchema |
GetStream
lua
function Reactive.GetStream(initialValueFunc)
-> ReactiveStreamGets a stream object.
Parameters:
| Name | Type | Description |
|---|---|---|
initialValueFunc | fun(): T | A function to get the initial value to send to new publishers |
Returns:
| Type | Description |
|---|---|
ReactiveStream |