Update manual.md

After destroying need to clear interval
This commit is contained in:
二哲 2018-12-02 20:20:56 +08:00 committed by 偏右
parent 3b9263f458
commit ad347a98e2

View File

@ -22,13 +22,16 @@ function countDown() {
title: 'This is a notification message',
content: `This modal will be destroyed after ${secondsToGo} second.`,
});
setInterval(() => {
const timer = setInterval(() => {
secondsToGo -= 1;
modal.update({
content: `This modal will be destroyed after ${secondsToGo} second.`,
});
}, 1000);
setTimeout(() => modal.destroy(), secondsToGo * 1000);
setTimeout(() => {
clearInterval(timer);
modal.destroy();
}, secondsToGo * 1000);
}
ReactDOM.render(