Fix #1585, add a helper function to add polling to a view