可以有人解释一下以下语法吗:
clear: function(callback?: ?(error: ?Error) => void): Promise {
// balabala here
}
anyone can help?
可以有人解释一下以下语法吗:
clear: function(callback?: ?(error: ?Error) => void): Promise {
// balabala here
}
anyone can help?
clear()
:/* flow */
...
clear((data) => {
...do something with *data*, like resolve the promise ...
}, (error) => {
...handle *error*, like reject the promise ...
})
...
它将返回一个Promise对象。
?(error: ?Error) => void
的含义是什么? - Damon Yuan