Minimalistic pubsub JavaScript implementation