allow to pass in action for dispatch function.