jsprop

A build macro to generate support code for native js properties.
https://github.com/yar3333/haxe-jsprop

To install, run:

haxelib install jsprop 2.2.1 

See using Haxelib in Haxelib documentation for more information.

README.md

jsprop

A build macro to generate support code for native js properties. Add 'Object.defineProperty()' at the start of constructor. Support get/set combinations which not assume to create real variable (get/set, get/never and never/set without @:isVar).

Usage

@:build(JsProp.all()) // generate support code for all properties
class Car
{
	var internalColor = "red";
	
	var color(get, set) : String;
	function get_color() return internalColor;
	function set_color(v) return internalColor = v;
}

@:build(JsProp.marked()) // generate support code for properties marked with '@:property' meta.
class Dog
{
	var internalColor = "brown";
	
	@:property
	var color(get, set) : String;
	function get_color() return internalColor;
	function set_color(v) return internalColor = v;
}
Contributors
yar3333
Version
2.2.1
Published
1 year ago
License
LGPL

All libraries are free

Every month, more than a thousand developers use Haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on GitHub!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on GitHub