I simple implementation of the publish/subscribe javascript pattern