观察者_js
class dataCenter {
	/**
	 * 初始化
	 */
	constructor(fn_list=[],...args) {
		this.fn_list = fn_list;
		this.data = args
		return new  Proxy(this.data,this.handler)
	}
	/**
	 * handler  数据劫持
	 */
	handler = () => {
		get: function(target, propKey, receiver) {
			return Reflect.get(target, propKey, receiver);
		},
		set: function(target, propKey, value, receiver) {
			this.cb(value,receiver)
			return Reflect.set(target, propKey, value, receiver);
		}
	}
	/**
	 * 注册回调->观察者
	 */
	ob=(fn)=>{
		this.fn_list.push(fn)
	}
	/**
	 * 发布者
	 */
	cb=(newvalue,oldValue)=>{
		const fn_list = this.fn_list;
		for(var i in fn_list){
			fn_list[i](newvalue,oldValue)
		}
	}
	remove=(fn)=>{
		//在当前回调列表移除该函数
	}
	

}