Skip to content

Instantly share code, notes, and snippets.

View robpearson's full-sized avatar

Rob Pearson robpearson

View GitHub Profile
@robpearson
robpearson / ReactiveIntervalPoller.m
Created April 16, 2014 21:47
ReactiveCocoa interval (polling) signal
@weakify(self);
RACSignal *timerSignal = [RACSignal
interval:10 onScheduler:[RACScheduler mainThreadScheduler]];
self.somethingSignal = [timerSignal
map:^id(id value) {
@strongify(self);
return self.something;
@robpearson
robpearson / MPXLocationService.m
Last active August 29, 2015 13:59
User Location Signal
// Location Service
- (RACSignal *)locationSignal {
// NOTE: Location service is a singleton thus no strongify/weakify
// TODO: Review previous service code to add checks on last object to ensure that it's up-to-date and of the correct accuracy.
// TODO: Review how to restart the timer. I'm currently using take: 1 so it's not needed immediately.
RACSignal *locationSignal = [[RACSignal