mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-21 06:35:11 +00:00
Create observable commits client
This commit is contained in:
25
Octokit.Reactive/Clients/ObservableCommitsClient.cs
Normal file
25
Octokit.Reactive/Clients/ObservableCommitsClient.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Reactive.Threading.Tasks;
|
||||
|
||||
namespace Octokit.Reactive
|
||||
{
|
||||
public class ObservableCommitsClient : IObservableCommitsClient
|
||||
{
|
||||
readonly ICommitsClient _client;
|
||||
|
||||
public ObservableCommitsClient(IGitHubClient client)
|
||||
{
|
||||
Ensure.ArgumentNotNull(client, "client");
|
||||
_client = client.GitDatabase.Commit;
|
||||
}
|
||||
|
||||
public IObservable<Commit> Get(string owner, string name, string reference)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||
Ensure.ArgumentNotNullOrEmptyString(reference, "reference");
|
||||
|
||||
return _client.Get(owner, name, reference).ToObservable();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user