Here's an example of using this hook on top of react-query.
When your react-query mutation succeeds, we'll only flash the success state for 3 seconds until it's reverted back to normal
const isSuccess = useEphemeralState(
mutation.isSuccess,
3000,
);