mharris717 / ember-cli-pagination

Pagination Addon for Ember CLI
MIT License
273 stars 116 forks source link

ember-concurrency way to get async working #273

Open brunoocasali opened 5 years ago

brunoocasali commented 5 years ago

Is there a way to get this working with ember-concurrency?

I'm using the ember-router-scroll addon, to support service way to call that functions... So to get what I want working I'm supposed to "call a set before and after".

pageClicked: task(function * (number) {
    this.set('scroll.preserveScrollPosition', true); // this

    this.set('currentPage', number);
    yield timeout(0); //check the snippet below:

    this.set('scroll.preserveScrollPosition', false); // and this
  }).drop()

I've tested this two another ways (including a suggested one: https://github.com/mharris717/ember-cli-pagination/pull/259)

yield this.get('action')(number);
yield this.sendAction('action', number);

So my workaround is calling with ember-concurrency timeout, is there a way to call sendAction behavior without the deprecation warning and get this things working?

Thanks for the awesome addon!

brunoocasali commented 5 years ago

@broerse could you help me with this problem?