Last active
August 29, 2015 14:02
-
-
Save robpearson/9be2c8bd4952e66a5173 to your computer and use it in GitHub Desktop.
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
// One Off | |
RACSignal *currentUserLocationSignalX = [self.locationService.locationSignal take:1]; | |
// Refresh User Location on a interval timer | |
RACSignal *currentUserLocationIntervalSignal = [[[RACSignal | |
interval:60 | |
onScheduler:RACScheduler.scheduler] | |
map:^id(id value) { | |
strongify(self); | |
return [self.locationService.locationSignal take:1]; | |
}] | |
flatten]; | |
// Refresh User Location every time the signal is accessed (handy when combining signals) | |
RACSignal *currentUserLocationSignal = [[RACSignal | |
createSignal:^RACDisposable *(id <RACSubscriber> subscriber) { | |
strongify(self); | |
[subscriber sendNext:[self.locationService.locationSignal take:1]]; | |
return nil; | |
}] flatten]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment