Skip to content

Instantly share code, notes, and snippets.

@andresmijares
Created March 19, 2017 20:08
Show Gist options
  • Save andresmijares/10b26a5b5bc148527bbf026cfd548d37 to your computer and use it in GitHub Desktop.
Save andresmijares/10b26a5b5bc148527bbf026cfd548d37 to your computer and use it in GitHub Desktop.
class FirebaseService () {
/* info omitted for convinience */
_sendPushNotification (id, order) { /*...*/ }
create (order) {
let {id} = order
this.__sendPushNotification(id, order)
}
}
class PouchDB () {
/* info omitted for convinience */
create (store, order) {
/* triggers and action */
store.dispatch({
type: 'ORDER_CREATE',
payload: order,
})
}
}
class MixPanelService () {
/* info omitted for convinience */
create () { /* logs to the create event on mixpanel */ }
}
/* they all are singletons */
export let firebaseService = new FirebaseService()
export let pouchDBService = new PouchDB()
export let mixpanelService = new MixPanelService()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment