Created
March 19, 2020 20:47
-
-
Save twittemb/0c3b2477cb0555fca57b4b335e0eea5e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// previously defined or injected: counterSpin is the Spin that handles our counter rules | |
self.uiSpin = UISpin(spin: counterSpin) | |
// self.uiSpin is now able to handle UI side effects | |
// we now want to attach the UI Spin to the rendering function of the ViewController: | |
self.uiSpin.render(on: self, using: { $0.render(state:) }) | |
// And once the view is ready (in “viewDidLoad” function for instance) let’s start the loop: | |
self.uiSpin.start() | |
// the underlying reactive stream will be disposed once the uiSpin will be deinit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment