可以通过 then 接口在关闭后运行 callback 。以上用例将在每个 message 将要结束时通过 then 显示新的 message 。
message provides a promise interface for onClose. The above example will display a new message when the old message is about to close.
message
onClose