반응형
- OnNext
observable.Subscribe(
value => Debug.Log($"OnNext: {value}"),
() => Debug.Log("OnCompleted")
);
- OnError
observable.Subscribe(
value => Debug.Log($"OnNext: {value}"),
error => Debug.LogError($"OnError: {error.Message}")
);
- OnCompleted
observable.Subscribe(
value => Debug.Log($"OnNext: {value}"),
() => Debug.Log("OnCompleted")
);
- OnDisposed
var subscription = observable.Subscribe(
value => Debug.Log($"OnNext: {value}"),
() => Debug.Log("OnCompleted")
);
// Dispose of the subscription when necessary
subscription.Dispose();
- OnUnsubscribed
var subscription = observable.Subscribe(
value => Debug.Log($"OnNext: {value}"),
() => Debug.Log("OnCompleted")
);
// Unsubscribe manually
subscription.Dispose();
참고용 사이트
반응형