From the Bounce spec it is not clear if you have to set the debounce "interval".
Perhaps the edge detector should be in while loop, but that would contradict the note that "update" must be done continuously - as you did,
It just makes me curious how "they" manage to make the "rose" edge to be just single shot.
What resets it and prevents repeated access to the if(_) construct.