local z=require(script.Parent.prettyPrint)local R={outputFunction=print}function R.middleware(m,C)return function(q)local N=m(q)R.outputFunction(("\065\099\116\105\111\110 \100\105\115\112\097\116\099\104\101\100\058 \037\115\n\083\116\097\116\101 \099\104\097\110\103\101\100 \116\111\058 \037\115"):format(z(q),z(C:getState())))return N end end return R

local prettyPrint = require(script.Parent.prettyPrint)
local loggerMiddleware = {
	outputFunction = print,
}

function loggerMiddleware.middleware(nextDispatch, store)
	return function(action)
		local result = nextDispatch(action)

		loggerMiddleware.outputFunction(("Action dispatched: %s\nState changed to: %s"):format(
			prettyPrint(action),
			prettyPrint(store:getState())
		))

		return result
	end
end

return loggerMiddleware
