docs for catch
This commit is contained in:
parent
d6cbba0b2e
commit
372cf30e8e
1 changed files with 3 additions and 1 deletions
|
|
@ -201,7 +201,7 @@ Deferred deferred() {void onerror(Error e)}
|
||||||
|
|
||||||
where:
|
where:
|
||||||
Deferred :: Object { Promise promise, void resolve(any value), void reject(any value) }
|
Deferred :: Object { Promise promise, void resolve(any value), void reject(any value) }
|
||||||
Promise :: GetterSetter { Promise then(any successCallback(any value), any errorCallback(any value)) }
|
Promise :: GetterSetter { Promise then(any successCallback(any value), any errorCallback(any value)), Promise catch(any errorCallback(any value)) }
|
||||||
GetterSetter :: any getterSetter([any value])
|
GetterSetter :: any getterSetter([any value])
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -213,6 +213,8 @@ where:
|
||||||
|
|
||||||
A promise is also a getter-setter (see [`m.prop`](mithril.prop.md)). After a call to either `resolve` or `reject`, it holds the result of the parent's computation (or the `resolve`/`reject` value, if the promise has no parent promises)
|
A promise is also a getter-setter (see [`m.prop`](mithril.prop.md)). After a call to either `resolve` or `reject`, it holds the result of the parent's computation (or the `resolve`/`reject` value, if the promise has no parent promises)
|
||||||
|
|
||||||
|
Promises also have a method called `catch`, which is equivalent to calling `then(null, errorCallback)`
|
||||||
|
|
||||||
- **Promise then([any successCallback(any value) [, any errorCallback(any value)]])**
|
- **Promise then([any successCallback(any value) [, any errorCallback(any value)]])**
|
||||||
|
|
||||||
This method accepts two callbacks which process a value passed to the `resolve` and `reject` methods, respectively, and pass the processed value to the returned promise
|
This method accepts two callbacks which process a value passed to the `resolve` and `reject` methods, respectively, and pass the processed value to the returned promise
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue