Sub/Pub service using both typescript and js thats able to provide consistent typing across functions