Recommend:develop a feature of callback function to the component of Message
See original GitHub issue现在的参数配置有
message.success(content, duration)
一个content、一个duration、常用的感觉就是加一个content的调用方式吧,第二个,场景不是特别大,但是有一个使用场景使用比较多,当message消失的时候,需要做一个些事情,比如刷新浏览器。 也不是不需要duration这个参数,判断第二个参数是object就是配置了,如果是function就是回调,第三个参数也可以是配置,{ duration , top } 这样子也和全局config一致配置了。
现在一般都是知道duration了,设置个定时器setTimeout( callback , duration )。然后去做一些事情,有点繁琐了。
大家觉得怎么样。
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
JavaScript Callback Functions – What are Callbacks in JS and ...
Callbacks make sure that a function is not going to run before a task is completed but will run right after the task...
Read more >What is a Callback Function in JavaScript? - Topcoder
A callback function is one of the superpowers of JavaScript. It is the way JavaScript passes a function into another function as an...
Read more >Callback function - IONOS
The function is only called and executed once a specific event has occurred. As previously mentioned, callback functions are used in a variety ......
Read more >Callback functions in C++ - Stack Overflow
One reason to use callbacks is to write generic code which is independant from the logic in the called function and can be...
Read more >Callback function - MDN Web Docs Glossary: Definitions of ...
A callback function is a function passed into another function as an argument, which is then invoked inside the outer function to complete ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Actually, I added onClose in 2015: https://github.com/ant-design/ant-design/commit/1e5271491e33a583af22a8693f6a57446ec6d9d4
I don’t know why I forgot the documentation… 😅
…