1

I have this code in a project:

 this.store.select(fromRoot.getFormFields).take(1)
  .subscribe(formFieldArray => {
    formFieldArray
      .filter(formField => formField.name === visibleOnField)
      .map(formField => {
        this.updateVisible(formField.value, visibleOnValue);
      });
  })

.. and a question was raised by a colleague if I shouldn't unsubscribe in case nothing is ever emitted. He argued that the 'this' reference will stay with the Observable and cause the garbage collector to never clean it up.

Is this the case? Or can I use take(1) without unsubscribing as I'm used to?

handgranat
  • 11
  • 1

0 Answers0