2019-09-09 20:16:47 +08:00

15 lines
327 B
TypeScript

export const behavior = Behavior({
methods: {
set(data: object, callback: Function) {
return new Promise(resolve => {
this.setData(data, () => {
if (callback && typeof callback === 'function') {
callback.call(this);
}
resolve();
});
});
}
}
});