-
RAC4 breaks the concept of signals into two distinct types: SignalProducers and Signals. A SignalProducer is very similar to the old RACSignal; it does nothing until it is started. The developers changed the terminology from subscribed to started because it more accurately describes the state of the signal. For example, a SignalProducer could have multiple observers that are set up to receive events sent on the signal, but the signal won’t become active and the observers won’t see any events until it is started by something. A signal is started by calling start() on it.
-
The other new type is Signal. A Signal is like a firehose. You hook it up to a source, and events travel through it. There is no starting of a Signal, so you can’t use it to kick off work in the same way a SignalProducer can. Signals also can’t maintain any history. When something begins observing a Signal’s events, it w
This file contains 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
import Foundation | |
import ReactiveSwift | |
import Result | |
let a = MutableProperty<String>("") | |
let b = MutableProperty<String>("") | |
let c = MutableProperty<String>("") | |
// Signals are hot | |
let signalDisposable = Signal.combineLatest(a.signal, b.signal, c.signal) |
This file contains 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
{ | |
"meta": { | |
"dataSource": "http://www.chas.sg/clinic_locator.aspx", | |
"lastUpdated": "2015-07-23T10:16:02.418Z", | |
"count": 1438 | |
}, | |
"data": [ | |
{ | |
"name": "115 Eastpoint Clinic & Surgery", | |
"address": "115 Bedok North Road, #01 - 301, Singapore - 460115", |
This file contains 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
// Load jQuery | |
(function(){ | |
var script = document.createElement('script'); | |
script.type = "text/javascript"; | |
script.src = "http://code.jquery.com/jquery-latest.min.js"; | |
document.getElementsByTagName('head')[0].appendChild(script); | |
})(); | |
// jQuery.noConflict(); |