Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split store methods related to API into lib module #8

Closed
bericp1 opened this issue Dec 29, 2014 · 1 comment
Closed

Split store methods related to API into lib module #8

bericp1 opened this issue Dec 29, 2014 · 1 comment

Comments

@bericp1
Copy link
Owner

bericp1 commented Dec 29, 2014

There are currently some methods I'm using repeatedly related to retrieving data from an API and that I can see using frequently in the future. They should be pulled into an external module in public/src/lib so that I can do something like the following:

var createAPIStore = require('create-api-store'); // `public/src/lib` has been added to the browserify search paths
var actions = require('./actions');
module.exports = createAPIStore('/api/items', {
  init: function(){
    this.listenTo(actions.reloadItems, this.reload);
    this.listenTo(actions.deleteItem, this.delete);
    this.listenTo(actions.addItem, this.add);
  }
});
@bericp1
Copy link
Owner Author

bericp1 commented Dec 30, 2014

Related to #20

@bericp1 bericp1 closed this as completed Dec 30, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant