Appearance
ReactiveStream
Inherits: Class, ReactiveSubject
Methods
GetNumPublishers
lua
function ReactiveStream:GetNumPublishers()
-> numberGets the number of publishers on the stream.
Returns:
| Type | Description |
|---|---|
number |
Publisher
lua
function ReactiveStream:Publisher()
-> ReactivePublisherSchemaCreates a new publisher for the stream.
Returns:
| Type | Description |
|---|---|
ReactivePublisherSchema |
Release
lua
function ReactiveStream:Release()Releases the stream.
Send
lua
function ReactiveStream:Send(data)Sends a new data value the stream's publishers.
Parameters:
| Name | Type | Description |
|---|---|---|
data | T | The data to send |
SetNoPublishersCallback
lua
function ReactiveStream:SetNoPublishersCallback(handler)
-> selfSets a callback for when there are no remaining publishers.
Parameters:
| Name | Type | Description |
|---|---|---|
handler | fun(stream: ReactiveStream) | The handler function |
Returns:
| Type | Description |
|---|---|
self |
_Acquire
lua
function ReactiveStream:_Acquire(initialValueFunc)Parameters:
| Name | Type | Description |
|---|---|---|
initialValueFunc | fun(): T |
__init
lua
function ReactiveStream:__init()Functions
Get
lua
function ReactiveStream.Get(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 |
_initialValueFunc
lua
function ReactiveStream._initialValueFunc()
-> <T>Returns:
| Type | Description |
|---|---|
<T> |