CombineCommunity / rxswift-to-combine-cheatsheet

RxSwift to Apple’s Combine Cheat Sheet
https://medium.com/gett-engineering/rxswift-to-apples-combine-cheat-sheet-e9ce32b14c5b
MIT License
2.04k stars 125 forks source link

Add Empty/Never #5

Closed stephencelis closed 5 years ago

stephencelis commented 5 years ago

I believe Publishers.Empty handles these cases.

freak4pc commented 5 years ago

Hey Stephen, Thanks :) Could you run ./generate.rb please?

stephencelis commented 5 years ago

Ah I don't have the repo checked out :) Editing on my phone. Also just added Timer.publish.

freak4pc commented 5 years ago

Ok, don't worry about it :) I'll merge and add it on my end.

freak4pc commented 5 years ago

I don't have the latest beta but is Timer.publish actually interval, or timer? Does it start emitting immediately, or only after the first timespan ?

freak4pc commented 5 years ago

I had a friend try the following code and it emits nothing:

Timer.publish(every: 0.1, on: .main, in: .default)
     .print()
     .sink { _ in }

Might be related to backpressure but I don't know much about it in Combine, yet. Have you tried Timer.publish ?