File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -224,6 +224,18 @@ And here's the final result:
224224
225225<Method name = " negate" returns = " SignalValue" />
226226
227+ #### debounce
228+
229+ > Delays an operation until a specified time has passed without further input.
230+
231+ <Method
232+ name = " debounce"
233+ args = { [
234+ [' ms' , ' number' ],
235+ ]}
236+ returns = " SignalValue"
237+ />
238+
227239#### tap
228240
229241> Executes a function with each value emitted by the observable.
@@ -286,6 +298,18 @@ And here's the final result:
286298 returns = " SignalValue"
287299/>
288300
301+ #### start_with
302+
303+ > Emits a default value immediately and synchronously after subscribing.
304+
305+ <Method
306+ name = " start_with"
307+ args = { [
308+ [' default_value' , ' T' ],
309+ ]}
310+ returns = " SignalValue"
311+ />
312+
289313#### observe
290314
291315> Subscribes an observer function to the observable. The observer function is called every time a new value is emitted by the observable.
Original file line number Diff line number Diff line change @@ -12,5 +12,6 @@ require("nui-components.rx.operators.scan")
1212require (" nui-components.rx.operators.skip" )
1313require (" nui-components.rx.operators.combine_latest" )
1414require (" nui-components.rx.operators.debounce" )
15+ require (" nui-components.rx.operators.start_with" )
1516
1617return Rx
Original file line number Diff line number Diff line change 1+ local Observable = require (" nui-components.rx.observable" )
2+ local fn = require (" nui-components.utils.fn" )
3+
4+ function Observable :start_with (...)
5+ local values = fn .pack (... )
6+
7+ return Observable .create (function (observer )
8+ observer :on_next (fn .unpack (values ))
9+ return self :subscribe (observer )
10+ end )
11+ end
Original file line number Diff line number Diff line change @@ -58,6 +58,16 @@ function SignalValue:skip(n)
5858 return self
5959end
6060
61+ function SignalValue :debounce (ms )
62+ self ._private .observable = self ._private .observable :debounce (ms )
63+ return self
64+ end
65+
66+ function SignalValue :start_with (value )
67+ self ._private .observable = self ._private .observable :start_with (value )
68+ return self
69+ end
70+
6171function SignalValue :combine_latest (...)
6272 local signal_values = { ... }
6373
You can’t perform that action at this time.
0 commit comments