 		}
 
 		set(d) {
-			let oldState = state.modify { (var state) in
-				state.innerDisposable = d
-				return state
+			let oldState = state.modify { state in
+				return state.withDisposable(d)
 			}
 
 			oldState.innerDisposable?.dispose()

/// A disposable that only flips `disposed` upon disposal, and performs no other
/// work.
public final class SimpleDisposable: Disposable {
	private var _disposed = Atomic(false)

	public var disposed: Bool {
		return _disposed.value


/// A disposable that will run an action upon disposal.
public final class ActionDisposable: Disposable {
	private let action: Atomic<(() -> ())?>

	public var disposed: Bool {
		return action.value == nil
