Skip to content

Instantly share code, notes, and snippets.

@dan-ste
Created July 6, 2017 09:44
Show Gist options
  • Save dan-ste/9322b10952a0de5d1561c92a8313a38e to your computer and use it in GitHub Desktop.
Save dan-ste/9322b10952a0de5d1561c92a8313a38e to your computer and use it in GitHub Desktop.
import { task } from 'ember-concurrency';
export default TutorialComponent.extend({
result: null,
findStores: task(function * () {
let geolocation = this.get('geolocation');
let store = this.get('store');
let coords = yield geolocation.getCoords();
let result = yield store.getNearbyStores(coords);
this.set('result', result);
}).drop(), // ++
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment