I tried to use an async function with setTimeout in order to add to history only after the state stops changing. Instead of saving every single change of state I wanted to save only when half a second has passed after the user's last action without a new action being executed. Is that possible?