Observer in Scala & JavaScript