Skip to content

Commit

Permalink
alternate class registration method (which create refs)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianharrigan committed Nov 14, 2023
1 parent d43d076 commit 79eba84
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions haxe/ui/core/ComponentClassMap.hx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ class ComponentClassMap {
instance.registerClassName(alias.toLowerCase(), className);
}

public static function registerClass(cls:Class<Any>, alias:String = null) {
var className = Type.getClassName(cls);
if (alias == null) {
alias = className.split(".").pop().toLowerCase();
}
instance.registerClassName(alias.toLowerCase(), className);
}

public static function list():Iterator<String> {
instance.load();
return instance._map.keys();
Expand Down

0 comments on commit 79eba84

Please sign in to comment.