How to deal with wanted delay on a string gadget?
Posted: Mon May 22, 2023 2:11 pm
Hello,
I don't need code, just an info: Let's say I have a StringGadget which is used for filtering a list. Now, I don't want to update the list on every edited character, but let's say one second after the last change was made. Naturally I would start a timer when something changes (and restart it, if it was already started), then process it after it fires. So far so good (and easy).
But, just out of curiosity, is there a better way to do it? Or some different approach, that's more efficient?
I don't need code, just an info: Let's say I have a StringGadget which is used for filtering a list. Now, I don't want to update the list on every edited character, but let's say one second after the last change was made. Naturally I would start a timer when something changes (and restart it, if it was already started), then process it after it fires. So far so good (and easy).
But, just out of curiosity, is there a better way to do it? Or some different approach, that's more efficient?