Skip to content

Instantly share code, notes, and snippets.

@thatguydan
Created September 18, 2012 06:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thatguydan/3741693 to your computer and use it in GitHub Desktop.
Save thatguydan/3741693 to your computer and use it in GitHub Desktop.
/*
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