I have the following code using Bond.
combineLatest(settings.userAutoRefreshInterval, config.value?.userRefreshInterval).observeNext { [weak self] _ in
self?.updateAutoUserRefresh()
}.dispose(in: self.bag)
Of course, that has a build error since Bond's combineLatest
doesn't accept optionals.
I have considered doing an if let
and writing basically the same code twice, but that feels really messy.
In JavaScript, you can pass in an array with each element as a separate parameter into a function. Like the following:
function test(a, b, c) {
console.log("a", a);
console.log("b", b);
console.log("c", c);
}
const array = ["Hello", "world", "!!!"];
test(...array);
Is there a way to do that in Swift?
If not, any ideas for how to get my code working and have it be as clean as possible?