def dispatch(*args)
      if args.first.is_a? Hash
        _dispatch(args.first, args[1])
      else
        if args[1].is_a? Proc
          _dispatch({ type: args.first }, args[1])
        else
          _dispatch({ type: args.first, payload: args[1] }, args[2])
        end
      end
    end
def dispatch(*args)
      if args.first.is_a? Hash
        _dispatch(args.first, args[1])
      else
        if args[1].is_a? Proc
          _dispatch({ type: args.first }, args[1])
        else
          _dispatch({ type: args.first, payload: args[1] }, args[2])
        end
      end
    end
Dispatches an action to all reducers. Can be called any of the following ways:
 Takes in an action and an optional callback proc, which will be called after the
 dispatch is finished.
 The action can be passed in either as a hash or as two seperate arguments.
 E.g. dispatch({ type: 'SOME_ACTION', payload: { key: 'value' } })
 is the same as dispatch('SOME_ACTION', { key: 'value' })
 Here's an example with a proc: dispatch('SOME_ACTION', { key: 'value' }, ->{ puts "The dispatch is done" })