It would be a good idea to provide a good example of a clean up function in a custom action.
Currently the docs do not support code blocks (inline code examples only), but it would be good to look into supporting this to make actions documentation much clearer.