Created
November 20, 2017 12:05
-
-
Save dratwas/520e213adbfbd446876d5fdc73fcd452 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
@implementation CalendarManager | |
{ | |
bool hasListeners; | |
} | |
// Will be called when this module's first listener is added. | |
-(void)startObserving { | |
hasListeners = YES; | |
} | |
// Will be called when this module's last listener is removed, or on dealloc. | |
-(void)stopObserving { | |
hasListeners = NO; | |
} | |
- (void)sendEvent { | |
if (hasListeners) { | |
[self sendEventWithName:@"SomeEvent" body:@{@"body": someBody}]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment