Skip to content

Instantly share code, notes, and snippets.

@nybblr
Created January 26, 2016 17:26
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nybblr/12509a87191dd6ae88ea to your computer and use it in GitHub Desktop.
Save nybblr/12509a87191dd6ae88ea to your computer and use it in GitHub Desktop.
Ember Data: Multiple data stores

Multiple Ember Data stores

Need a separate data store? Maybe a temporary one for search results? Go for it!

// app/components/search-box.js
import Ember from 'ember';

export default Ember.Component.extend({
  store: Ember.inject.service('search-store'),
  results: function() {
    return this.get('store').query('search', { query: "I haz cheese" });
  }
});
// app/services/search-store.js
import DS from 'ember-data';

export default DS.Store.extend({
  mySearchStore: true
});
@Redsandro
Copy link

How would one apply a custom adapter to this service?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment