#127 Rename druid:create() to druid:new(). Create deprecated

This commit is contained in:
Insality
2021-04-04 13:52:12 +03:00
parent 20e65d8ff6
commit 4ea9f18e10
3 changed files with 43 additions and 24 deletions

View File

@@ -35,6 +35,7 @@ local function get_druid_instances()
return _instances
end
--- Register external druid component.
-- After register you can create the component with
-- druid_instance:new_{name}. For example `druid:new_button(...)`
@@ -45,7 +46,7 @@ function M.register(name, module)
-- TODO: Find better solution to creating elements?
-- Current way is very implicit
druid_instance["new_" .. name] = function(self, ...)
return druid_instance.create(self, module, ...)
return druid_instance.new(self, module, ...)
end
end