Created
September 18, 2012 06:56
-
-
Save thatguydan/3741693 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
/* | |
1) Model everything | |
- User | |
- Block | |
- Device | |
- Credential | |
- Rule | |
- Token | |
- ClientApplication | |
- DeviceCallback | |
2) EventEmitter is your friend, add it to all the prototypes | |
3) Do cool stuff like this: | |
*/ | |
device.once('ActuatedEvent',function(err) { | |
if (err) throw err | |
else user.notify('Device Actuated'); | |
}); | |
credential.once('FetchedEvent',function(err,creds) { | |
if (err) throw err | |
else device.actuate(user, 'twitter', creds, tweet); | |
}); | |
credential.fetch(user, 'twitter'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment