Conversation
|
Also added a simple clearConsole option to make it easier to see reload changes |
|
Could you tell me your system specs? OS/arch/version? May be there is something we can do in the watcher itself. Clear console is a nice feature 👍🏽 |
|
I am running Debian 10.13 on amd64. Maybe it is an issue with my systems. But I think it is still an important feature to include. If lets say you delete a folder with files, every file delete will trigger a reload. With delay, reload will be only triggered once as intended. |
| class Recharge { | ||
| final String path; | ||
| final void Function()? onReload; | ||
| int delay; |
There was a problem hiding this comment.
It is up to you. I think keeping it the way it is now is okay too. Because delays are generally in millisecond range (500ms-20ms). 200ms seems like a good default value in my opinion
There was a problem hiding this comment.
I was not talking about the number. I meant to make the datatype Duration(milliseconds: 200) instead of int. It is better to use the built in datatype that is meant for this purpose.
|
|
||
| // print("application reloaded") | ||
|
|
|
@romanzy313 Sorry got a bit busy. I will merge after these minor changes. |
Added a simple de-bounce with a default delay of 200ms. On my system every file save fires the event twice, and this fixes the issue