return function(r,D)return function(Z,C)if Z==nil then Z=r end local L=D[C.type]if L then return L(Z,C)end return Z end end
return function(initialState, handlers)
	return function(state, action)
		if state == nil then
			state = initialState
		end

		local handler = handlers[action.type]

		if handler then
			return handler(state, action)
		end

		return state
	end
end
