# Function: offAttributesUpdate
▸ offAttributesUpdate(handler?
: AttributesUpdateEventHandler): void
停止监听 属性列表更新事件
example
import { attributeSystem } from '@timi/mogs-sdk';
// ...
// 定义一个事件处理函数
const handler: attributeSystem.AttributesUpdateEventHandler = function (event) {
console.log(event);
};
attributeSystem.onAttributesUpdate(handler);
// 取消刚刚注册的事件处理函数
attributeSystem.offAttributesUpdate(handler);
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
# 参数:
属性 | 类型 | 描述 |
---|---|---|
handler? | AttributesUpdateEventHandler | 要取消注册的属性列表更新事件处理函;若未传入参数,则默认取消所有事件处理函数。 |
AttributesUpdateEventHandler: MogsEventHandler‹AttributesUpdateEvent›
AttributesUpdateEvent
结构
属性 | 类型 | 描述 |
---|---|---|
currentValue | ReadonlyClone‹Attribute[]› | 数据改变后的值 |
previousValue | ReadonlyClone‹Attribute[]› | 数据改变前的值 |
type | Update | 事件类型,由具体的事件构造时提供 |
# 返回值:
void