# Is there a better way of doing it?

**URL:** <https://discuss.emberjs.com/t/is-there-a-better-way-of-doing-it/13201>\
**Category:** Uncategorized\
**Created:** [June 29, 2017, 12:55pm UTC](https://discuss.emberjs.com/t/is-there-a-better-way-of-doing-it/13201 "2017-06-29T12:55:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnunclesam](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@johnunclesam](https://discuss.emberjs.com/u/johnunclesam)\
**Post date:** [June 29, 2017, 12:55pm UTC](https://discuss.emberjs.com/t/is-there-a-better-way-of-doing-it/13201/1 "2017-06-29T12:55:12Z")

</div>

I have this code:

```
new Ember.RSVP.Promise((resolve) => {
	let promise = myList.pushObject(book);
	resolve(promise);
}).then(() => {
	this.send('scrollToBottom', '#myList');
});

```

Is there a better way of doing it?

---

<div class="post-metadata">

**Author:** ![alexspeller](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/alexspeller/32/14812_2.png) [@alexspeller](https://discuss.emberjs.com/u/alexspeller)\
**Post date:** [June 29, 2017, 11:37pm UTC](https://discuss.emberjs.com/t/is-there-a-better-way-of-doing-it/13201/2 "2017-06-29T23:37:04Z")

</div>

yes:

```auto
myList.pushObject(book);
Ember.run.schedule('afterRender', this, 'send', 'scrollToBottom', '#myList');

```

The promise code is not doing anything except happening to be async. It may or may not pause long enough to allow rendering. Instead, use the runloop to do stuff at the right time.

---

<div class="post-metadata">

**Author:** ![lightblade](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/lightblade/32/15632_2.png) [@lightblade](https://discuss.emberjs.com/u/lightblade)\
**Post date:** [June 30, 2017, 6:26am UTC](https://discuss.emberjs.com/t/is-there-a-better-way-of-doing-it/13201/3 "2017-06-30T06:26:19Z")

</div>

RSVP Promise resolves in the same run loop. So it’s not really async anyway.

---

<div class="post-metadata">

**Author:** ![johnunclesam](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@johnunclesam](https://discuss.emberjs.com/u/johnunclesam)\
**Post date:** [June 30, 2017, 8:03am UTC](https://discuss.emberjs.com/t/is-there-a-better-way-of-doing-it/13201/4 "2017-06-30T08:03:18Z")

</div>

@lightblade is this an aswer to me?
