Function onDiagnosticsChange

Subscribe to diagnostics. Invoked immediately with the current value, then on every host push. Returns an unsubscribe.