class DataPersistence{
    constructor(){
    }
    static action = {
        xxx1: ()=>{},
        xxx2: ()=>{}
    }
    
    addAction(data){
        if(data){
            for(let name in data){
                if(DataPersistence.action[name]){
                    console.error('警告：覆盖了一个名为[' + name + ']的行为处理函数');
                }
                DataPersistence.action[name] = data[name];
            }
        }
    }
    
    getAction(name){
        return DataPersistence.action[name];
    }
} 
let instance = null;
if(!window._coneDataPersistence){
    instance = new DataPersistence();
    window._coneDataPersistence = instance;
}
export default window._coneDataPersistence;