# Source: jsframework/core/data/data.js

    /**
     * Created by zhangmike on 16/10/18.
     */
    export default class GMPX {
        constructor(state) {
            this._init(state);
        }
        _init(state) {
            if (!state) {
                return Object.create(null);
            }
            var keys = Object.keys(state);
            this.state = state;
            var that = this;
            for (var i = 0, l = keys.length; i < l; i++) {
                var key = keys[i],
                    val = this.state[keys[i]];
                var property = Object.getOwnPropertyDescriptor(this.state, key);
                if (property && property.configurable === false) {
                    continue;
                }

                (function(k, v) {
                    Object.defineProperty(that.state, k, {
                        enumerable: true,
                        configurable: true,
                        get: function reactiveGetter() {
                            return v;
                        },
                        set: function reactiveSetter(newVal) {
                            var value = v;
                            if (newVal === value) {
                                return;
                            }
                            v = newVal;
                        }
                    });
                })(key, val);
            }
        }
    }