# Source: data/data.js

    /**
     * Created by zhangmike on 16/10/18.
     */

    export default function GMPX(state) {
        this._init(state);
    };

    GMPX.prototype._init = function(state) {
        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);
        }
    };