Skip to content

ReactiveStream

Inherits: Class, ReactiveSubject

Methods

GetNumPublishers

lua
function ReactiveStream:GetNumPublishers()
  -> number

Gets the number of publishers on the stream.

Returns:

TypeDescription
number

Publisher

lua
function ReactiveStream:Publisher()
  -> ReactivePublisherSchema

Creates a new publisher for the stream.

Returns:

TypeDescription
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:

NameTypeDescription
dataTThe data to send

SetNoPublishersCallback

lua
function ReactiveStream:SetNoPublishersCallback(handler)
  -> self

Sets a callback for when there are no remaining publishers.

Parameters:

NameTypeDescription
handlerfun(stream: ReactiveStream)The handler function

Returns:

TypeDescription
self

_Acquire

lua
function ReactiveStream:_Acquire(initialValueFunc)

Parameters:

NameTypeDescription
initialValueFuncfun(): T

__init

lua
function ReactiveStream:__init()

Functions

Get

lua
function ReactiveStream.Get(initialValueFunc)
  -> ReactiveStream

Gets a stream object.

Parameters:

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

Returns:

TypeDescription
ReactiveStream

_initialValueFunc

lua
function ReactiveStream._initialValueFunc()
  -> <T>

Returns:

TypeDescription
<T>