Wait until setState completes to emit change