a reactive utility for javascript promise