Skip to content

Instantly share code, notes, and snippets.

View leeoades's full-sized avatar

Lee Oades leeoades

View GitHub Profile
{
"meta": {
"theme": "stackoverflow"
},
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"basics": {
"name": "Lee Oades",
"label": "Senior Software Developer",
"image": "https://avatars2.githubusercontent.com/u/2321091?s=800",
"email": "[email protected]",
@leeoades
leeoades / PausableObservableTests
Created December 17, 2012 12:29
Unit Tests for Pausable Observable
namespace Stuff
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reactive.Linq;
using System.Reactive.Subjects;
using Core.Extensions;
using Microsoft.Reactive.Testing;
using NUnit.Framework;
@leeoades
leeoades / Pausable Observable
Created December 17, 2012 12:27
Pause an RX stream
public static IObservable<T> Pausable<T>(
this IObservable<T> sourceStream,
IObservable<bool> isPausedStream,
bool startPaused = false)
{
return Observable.Create<T>(o =>
{
var subscriptions = new SerialDisposable();
var replaySubjects = new SerialDisposable();
@leeoades
leeoades / Cache.cs
Created November 20, 2012 00:03
An Observable Cache
using System;
using System.Reactive.Concurrency;
using System.Reactive.Linq;
using System.Reactive.Subjects;
namespace Stuff
{
public class Cache<T> : IDisposable
{
private readonly IConnectableObservable<T> _source;