Last active
January 30, 2018 13:19
-
-
Save RichardSilveira/c4515634482c38e4ac358e53abb85dad to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const subject = new Rx.Subject(); | |
const subscription = subject.subscribe({ | |
next: valor => console.log(`observerB consumindo informação: ${valor}`), | |
error: err => console.log('observerB recebendo uma notificação de erro') | |
}) | |
subject.next(1) | |
/* Cancelando a "inscrição" no Stream de eventos emitidos pela instância de `subject`. | |
Eventos poderão ser inseridos no Stream de subject, só não serão mais "escutados" para esse contexto*/ | |
subscription.unsubscribe() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment