# Class PBMUpdateable

监听者模式

#### Example

    new Subscribe<{
    "foo": [arg1: number, arg2: string],
    "bar": [arg: boolean],
    }>()

#### Hierarchy (View Summary)

- Subscribe<{ update: () => void }>
  - PBMUpdateable
    - PBMPanoFilter
    - PBMCustomShader

- Defined in lib/five/model/materials/pbmMaterial.ts:26

##### Index

### Constructors

constructor

### Methods

emit
hasListener
off
on
once
waitUntil

## Constructors

### constructor

- new PBMUpdateable(): PBMUpdateable

  #### Returns PBMUpdateable

  Inherited from Subscribe.constructor

## Methods

### emit

- emit<K extends "update">(
  name: K,
  ...data: Parameters<{ update: () => void }[K]>,
  ): boolean

  触发事件

  #### Type Parameters

  - K extends "update"

    预设的监听事件名称

  #### Parameters

  - name: K

    事件类型

  - ...data: Parameters<{ update: () => void }[K]>

    触发事件的数据

  #### Returns boolean

  canceled 是否被触发取消

  Inherited from Subscribe.emit

  - Defined in lib/five/utils/subscribe.ts:131

### hasListener

- hasListener(name: "update"): boolean

  判断是否注册了事件

  #### Parameters

  - name: "update"

    事件类型

  #### Returns boolean

  Inherited from Subscribe.hasListener

  - Defined in lib/five/utils/subscribe.ts:44

### off

- off<K extends "update">(
  name?: K,
  callback?: (
  ...args: Parameters<{ update: () => void }[K]>,
  ) => ReturnType<{ update: () => void }[K]>,
  ): void

  解除事件

  如果 name 不传的话解除对应所有事件 如果 name, callback 不传的话解除所有name的所有事件

  #### Type Parameters

  - K extends "update"

    预设的监听事件名称

  #### Parameters

  - `Optional` name: K

    事件类型

  - `Optional` callback: (
    ...args: Parameters<{ update: () => void }[K]>,
    ) => ReturnType<{ update: () => void }[K]>

    事件回调函数

  #### Returns void

  Inherited from Subscribe.off

  - Defined in lib/five/utils/subscribe.ts:97

### on

- on<K extends "update">(
  name: K,
  callback: (
  this: this,
  ...args: Parameters<{ update: () => void }[K]>,
  ) => ReturnType<{ update: () => void }[K]>,
  once?: boolean,
  ): () => void

  注册事件

  #### Type Parameters

  - K extends "update"

    预设的监听事件名称

  #### Parameters

  - name: K

    事件类型

  - callback: (
    this: this,
    ...args: Parameters<{ update: () => void }[K]>,
    ) => ReturnType<{ update: () => void }[K]>

    事件回调函数

  - `Optional` once: boolean

    是否只执行一次

  #### Returns () => void

  解除事件

  Inherited from Subscribe.on

  - Defined in lib/five/utils/subscribe.ts:58

### once

- once<K extends "update">(
  name: K,
  callback: (
  this: this,
  ...args: Parameters<{ update: () => void }[K]>,
  ) => ReturnType<{ update: () => void }[K]>,
  ): () => void

  注册事件(是否只执行一次)

  #### Type Parameters

  - K extends "update"

    预设的监听事件名称

  #### Parameters

  - name: K

    事件类型

  - callback: (
    this: this,
    ...args: Parameters<{ update: () => void }[K]>,
    ) => ReturnType<{ update: () => void }[K]>

    事件回调函数

  #### Returns () => void

  解除事件

  Inherited from Subscribe.once

  - Defined in lib/five/utils/subscribe.ts:81

### waitUntil

- waitUntil<K extends "update">(
  name: K,
  filter?: (...args: Parameters<{ update: () => void }[K]>) => boolean | void,
  ): Promise<Parameters<{ update: () => void }[K]>>

  等待事件

  #### Type Parameters

  - K extends "update"

    预设的监听事件名称

  #### Parameters

  - name: K

    事件类型

  - `Optional` filter: (...args: Parameters<{ update: () => void }[K]>) => boolean | void

    事件类型

  #### Returns Promise<Parameters<{ update: () => void }[K]>>

  触发事件的数据

  Inherited from Subscribe.waitUntil

  - Defined in lib/five/utils/subscribe.ts:155