add toFn definition to integration example

This has not been defined in any of the examples above.