rokucommunity / promises

Promise library for roku
MIT License
7 stars 4 forks source link

Fixed uses where observers where never unregistered #5

Closed chrisdp closed 1 year ago

chrisdp commented 1 year ago

Fix to address #4

The root issue was that:

  1. we would never stop watching completed promises meaning re-use of completed promise within a given component/main source could fire more than once.
  2. when initially registering observers we would not un-register any existing ones leading to more then one being added per given component/source scope when using the same promise more then once in that scope.

Also added a small change to unobserve the delay timers so as to free up the observer memory in the background once completed as well.