Skip to content

Instantly share code, notes, and snippets.

@andresmijares
Created March 19, 2017 20:08
Show Gist options
  • Save andresmijares/72c8dbe002709b7d48795d5c13545b4c to your computer and use it in GitHub Desktop.
Save andresmijares/72c8dbe002709b7d48795d5c13545b4c to your computer and use it in GitHub Desktop.
class Model {
constructor (store = {}, services = []) {
this.services = services
this._store = store
}
asyncOperation (action, ...rest) {
return this.services.map((service) => {
if (service[action]) {
return service[action](this._store, ...rest)
}
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment