Instead of the verbose setOnClickListener:
RxView.clicks(submitButton).subscribe(o -> log("submit button clicked!"));Observable
.just(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)| default_platform :android | |
| platform :android do | |
| before_all do | |
| ENV["SLACK_URL"] = "https://hooks.slack.com/services/ABC/123/XYZ" | |
| end | |
| ######################### PUBLIC LANES ######################### | |
| desc "Deploy a new Prod APK version to Play Store Alpha" |
| import Foundation | |
| import RxSwift | |
| import PlaygroundSupport | |
| PlaygroundPage.current.needsIndefiniteExecution = true | |
| class TryOut { | |
| private var timer: Timer! | |
| private let data = Array<Int>(1...5) // data to broadcast asynchronously |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| /* | |
| An Object is considered to be a **functor** when it implements fmap (fmap referring to functor map not flatmap) | |
| -[Rules] This fmap should | |
| * preserve Identity (x to y) and (y to x ) should be the same value every time | |
| * and be composable | |
| map isn't fmap but fmap can do what map does | |
| map only operates on pure function, where fmap is lifted that pure function to operate on functor type | |
| */ |
| osascript -e 'tell application "iOS Simulator" to quit' | |
| osascript -e 'tell application "Simulator" to quit' | |
| xcrun simctl erase all |
| import PlaygroundSupport | |
| import Foundation | |
| import UIKit | |
| PlaygroundPage.current.needsIndefiniteExecution = true | |
| //data model | |
| struct User { | |
| let name:String | |
| } | |
| enum Result<T> { |
using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies
using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies
| // Mark: -Facebook | |
| func loginWithFaceBookInBackground(sender:UIButton) { | |
| let permissions = ["public_profile", "email"] | |
| PFFacebookUtils.logInInBackgroundWithReadPermissions(permissions) { (_user:PFUser?, _error:NSError?) in | |
| if _error == nil { | |
| if let possibleUser = _user{ | |
| print("\(possibleUser.sessionToken) , \(possibleUser)") | |
| if possibleUser.isNew { | |
| self.accessingFacebookCredentialsToSaveToParse() |