New at ReactiveSwift and FRP in general, trying to build a small calculator app to try to get the hang of it and I'm stuck figuring out the reactive way to do something like this. If I have a function that takes a value, how do I pass that value to a stream that is constantly applying a function that takes the value passed, and the result of all the previous values? For example, how would I add up a stream of integers? Sample code would be super helpful. Something like this
func apply(_ value: Int) {
/// sends value to a stream that emits (value + previous values) to its observers
}