add an example for on_pause()

There is no information on how to exactly use on_pause() so here's an example.

I'm a beginner with the docs, so check if it's done correctly.