import { Observable } from '@hullo/core';
// first - create a subject with some publisher
const answersToAll = new Observable(
// observer represents future subscriber
// let's send it a simple message
// second - there is a subscriber
// do sth with the received message
// do sth when publisher decided
// to not push any more messages
// third - connect subscriber to the subject
const subscription = answersToAll.subscribe(subscriber);
// (bonus) you can stop receiving messages
// externally to both publisher and subscriber
// through subscription object