nx.Observable - Next UI Toolkit

#

API Docs for: trial
Show: Inherited Protected Private Deprecated

# nx.Observable Class

Module: nx

- Index
- Methods

## Item Index

### Methods

- dispose
- monitor static
- watch static
- clearBinding
- getBinding
- notify
- setBinding
- unwatch

## Methods

### `dispose`

()

Dispose current object.

### `monitor`

(

- `target`
- `pathlist`
- `callback`

)
static

Monitor several paths of target at the same time, any value change of any path will trigger the callback with all values of all paths.

#### Parameters:

- `target` Object

  The target observable object.

- `pathlist` Object

  The path list to be watched.

- `callback` Object

  The callback function accepting arguments list: (value1, value2, value3, ..., changed_path, changed_old_value).

#### Returns:

Resource stub object, with release and affect methods.

release: release the current monitoring.

affect: invoke the callback with current values immediately.

### `watch`

(

- `target`
- `path`
- `callback`
- `context`

)
static

This method in order to watch the change of specified path of specified target.

#### Parameters:

- `target` Object

  The target observable object.

- `path` Object

  The path to be watched.

- `callback` Object

  The callback function accepting arguments list: (path, newvalue, oldvalue).

- `context` Object

  (Optional) The context which the callback will be called with.

#### Returns:

Resource stub object, with release and affect methods.

release: unwatch the current watching.

affect: invoke the callback with current value immediately.

### ``

(

- `names`
- `handler`
- `context`

)

#### Parameters:

- `names` Object
- `handler` Object
- `context` Object

### `clearBinding`

(

- `prop`

)

Clear binding for specified property.

#### Parameters:

- `prop` Object

### `getBinding`

(

- `prop`

)

Get existing binding object for specified property.

#### Parameters:

- `prop` Object

#### Returns:

:

### `notify`

(

- `names`
- `oldValue`

)

#### Parameters:

- `names` Object
- `oldValue` Object

### `setBinding`

(

- `prop`
- `expr`
- `source`

)

Set binding for specified property.

#### Parameters:

- `prop` Object
- `expr` Object
- `source` Object

### `unwatch`

(

- `names`
- `handler`
- `context`

)

#### Parameters:

- `names` Object
- `handler` Object
- `context` Object