# Component lifecycle & didReceiveAttrs

**URL:** <https://discuss.emberjs.com/t/component-lifecycle-didreceiveattrs/11905>\
**Category:** Uncategorized\
**Created:** [November 9, 2016, 9:52pm UTC](https://discuss.emberjs.com/t/component-lifecycle-didreceiveattrs/11905 "2016-11-09T21:52:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![accelerate](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/accelerate/32/11324_2.png) [@accelerate](https://discuss.emberjs.com/u/accelerate)\
**Post date:** [November 9, 2016, 9:52pm UTC](https://discuss.emberjs.com/t/component-lifecycle-didreceiveattrs/11905/1 "2016-11-09T21:52:14Z")

</div>

Hello,

Hopefully quick question. Will a component go through its lifecycle only if its attributes change? ie, if I have

```
{{my-component foo=bar}}

```

And `bar` never changes (or it gets set to the same value as before), that means the component lifecycle will never run again, correct?

The reason I ask is that I necessarily need to have some components refresh itself (by running some loading methods within the component) even if its attributes remain the same. So what I decided to do was pass in a timestamp (so in the above, I set `bar = Date.now();`). And I’m relying on `didReceiveAttrs()` to execute every time I update that timestamp so I can go through my refreshing logic. I’m wondering if this is actually an okay thing to do (paradigm-wise).

---

<div class="post-metadata">

**Author:** ![acorncom](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/acorncom/32/12198_2.png) [@acorncom](https://discuss.emberjs.com/u/acorncom)\
**Post date:** [November 10, 2016, 3:56am UTC](https://discuss.emberjs.com/t/component-lifecycle-didreceiveattrs/11905/2 "2016-11-10T03:56:36Z")

</div>

It’s reasonable but slightly messy 😉 Rhere’s an example of polling here as part of the ember concurrency setup that might give you some ideas … [http://ember-concurrency.com/#/docs/examples/route-tasks/4](http://ember-concurrency.com/#/docs/examples/route-tasks/4)
