jsprop

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

To install, run:

haxelib install jsprop 2.1.0 

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.1.0
Published
2 years ago
License
LGPL

All libraries are free

Every month, more than 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