File tree 2 files changed +13
-1
lines changed
lua/nui-components/signal
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -268,6 +268,7 @@ And here's the final result:
268
268
name = " combine_latest"
269
269
args = { [
270
270
[' ...' , ' SignalValue[]' ],
271
+ [' combinator_fn' , ' fun(...): T' ]
271
272
]}
272
273
returns = " SignalValue"
273
274
/>
Original file line number Diff line number Diff line change @@ -59,7 +59,18 @@ function SignalValue:skip(n)
59
59
end
60
60
61
61
function SignalValue :combine_latest (...)
62
- self ._private .observable = self ._private .observable :combine_latest (... )
62
+ local signal_values = { ... }
63
+
64
+ local sources = fn .imap (signal_values , function (signal_value , index )
65
+ if type (signal_value ) ~= " function" and not (index == # signal_values ) then
66
+ return signal_value :get_observable ()
67
+ end
68
+
69
+ return signal_value
70
+ end )
71
+
72
+ self ._private .observable = self ._private .observable :combine_latest (fn .unpack (sources ))
73
+
63
74
return self
64
75
end
65
76
You can’t perform that action at this time.
0 commit comments