-
Notifications
You must be signed in to change notification settings - Fork 86
Open
Description
https://github.com/rxi/lume/blob/da0d1bb/lume.lua#L694-L695
local newmod = require(modname)
if type(oldmod) == "table" then update(oldmod, newmod) endcurrently, if the returned value of a module isn't a table, it (newmod) is discarded.
in my case, my module returns a function, and i expect package.loaded to contain the new value. i am using lurker.lua to trigger hotswapping.
local some_state = 'blah'
local function exec_stuff(name)
local f = require('stuff_'..name) -- bug: never returns new function value
some_state = f(some_state)
endthis dirty hack seems to work:
- if type(oldmod) == "table" then update(oldmod, newmod) end
+ if type(oldmod) == "table" then update(oldmod, newmod) else oldmod = newmod endMetadata
Metadata
Assignees
Labels
No labels