You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This works but is clunky, it would be better to instead promote the fields of the variable into static fields of this class, for example, cheerio has a function, load():
haxiomic
changed the title
Add member fields as statics for module-variable-classes
Module-level field support or improve class based workaround
Apr 27, 2021
In TypeScript we have module-level fields like:
Ideally we can represent this in haxe as:
But
@:jsRequire()
doesn't yet work for module-level-fieldsA work around is to convert this to a class that just contains a value:
This works but is clunky, it would be better to instead promote the fields of the variable into static fields of this class, for example,
cheerio
has a function,load()
:However, to support overloads, we require the
overload
keyword which is only available in haxe 4.2+It may make sense to spend effort getting module-level extern fields to work in haxe rather than improve this workaround
The text was updated successfully, but these errors were encountered: