I have an observer against a Signal that is producing an item count in my app. Ideally, I would like to skip all values of 0, which I have attempted to do using the following code snippet:
viewModel.itemCount.signal
.skipRepeats()
.skip(while: { itemCount -> Bool in return itemCount == 0 })
.observeValues { itemCount in
print("Item count: \(itemCount)") // Will still print 0
}
Unfortunately, it is still allowing a value of 0 to pass through.