local function q(q,B)assert(type(q)=="\115\116\114\105\110\103","\066\097\100 \097\114\103\117\109\101\110\116 \035\049\058 \069\120\112\101\099\116\101\100 \097 \115\116\114\105\110\103 \110\097\109\101 \102\111\114 \116\104\101 \097\099\116\105\111\110 \099\114\101\097\116\111\114")assert(type(B)=="\102\117\110\099\116\105\111\110","\066\097\100 \097\114\103\117\109\101\110\116 \035\050\058 \069\120\112\101\099\116\101\100 \097 \102\117\110\099\116\105\111\110 \116\104\097\116 \099\114\101\097\116\101\115 \097\099\116\105\111\110 \111\098\106\101\099\116\115")return setmetatable({name=q},{__call=function(j,...)local S=B(...)assert(type(S)=="\116\097\098\108\101","\073\110\118\097\108\105\100 \097\099\116\105\111\110\058 \065\110 \097\099\116\105\111\110 \099\114\101\097\116\111\114 \109\117\115\116 \114\101\116\117\114\110 \097 \116\097\098\108\101")S.type=q return S end})end return q
--[[
	A helper function to define a Rodux action creator with an associated name.
]]
local function makeActionCreator(name, fn)
	assert(type(name) == "string", "Bad argument #1: Expected a string name for the action creator")

	assert(type(fn) == "function", "Bad argument #2: Expected a function that creates action objects")

	return setmetatable({
		name = name,
	}, {
		__call = function(self, ...)
			local result = fn(...)

			assert(type(result) == "table", "Invalid action: An action creator must return a table")

			result.type = name

			return result
		end,
	})
end

return makeActionCreator
