Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

加入机制 类似 inject_module 用于动态注入 #30

Open
luxuia opened this issue Jul 5, 2024 · 1 comment
Open

加入机制 类似 inject_module 用于动态注入 #30

luxuia opened this issue Jul 5, 2024 · 1 comment
Labels

Comments

@luxuia
Copy link

luxuia commented Jul 5, 2024

local global = require('global')

--- inject_module global
local indexs = {
    mgr_a = 'module.mgr_a',
    mgr_b = 'module.mgr_b',
}

function mt:init()
    for k, v in pairs(indexs) do
        global[k] = require(v)
    end
end

用于提示模块会被动态注入到global表中. 可能也会有inject_table 之类的需求.

@CppCXY CppCXY added the enhancement New feature or request label Jul 5, 2024
@CppCXY
Copy link
Owner

CppCXY commented Jul 5, 2024

以后再说

@CppCXY CppCXY added no plan and removed enhancement New feature or request labels Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants