This commit is contained in:
lx
2026-07-06 14:01:11 -04:00
commit c4f97d729d
16468 changed files with 935321 additions and 0 deletions
@@ -0,0 +1,17 @@
--[[
A middleware that allows for functions to be dispatched.
Functions will receive a single argument, the store itself.
This middleware consumes the function; middleware further down the chain
will not receive it.
]]
local function thunkMiddleware(nextDispatch, store)
return function(action)
if typeof(action) == "function" then
return action(store)
else
return nextDispatch(action)
end
end
end
return thunkMiddleware