You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-18
Original file line number
Diff line number
Diff line change
@@ -12,32 +12,25 @@ This is a library implementing [futures](https://en.wikipedia.org/wiki/Future_%2
12
12
13
13
**Recent Changes**
14
14
15
-
- Bit the breaking change bullet and changed some names so they're not stuck once v1 hits.
16
-
- Fixed lack of "toc" prefixes on array category methods like `asyncThenAll` (now `toc_thenAll`).
17
-
- Shortened excessively long names, such as `futureWithResultFromAsyncOperationWithResultLastingUntilCancelled` becoming `futureFromUntilOperation`.
18
-
- Added `matchLastToCancelBetween:and:` and `matchFirstToCancelBetween:and:` constructors to `TOCCancelToken`, to allow combining lifetimes a bit more flexibly.
19
-
- Added check of cancel token *after* returning to main thread, to allow UI code to assume that observing a token as cancelled implies no more returning-to-main-thread on-cancel callbacks will occur.
20
-
21
-
**Incoming Changes**
22
-
- Version 1
23
-
- Shortening #import "TwistedOakCollapsingFutures.h" to #import "CollapsingFutures.h"
15
+
- Version 1.
16
+
- Deprecated "TwistedOakCollapsingFutures.h" for "CollapsingFutures.h".
17
+
- Futures are now equatable (by current state then by will-end-up-in-same-state-with-same-value).
24
18
25
19
Installation
26
20
============
27
21
28
22
**Method #1: [CocoaPods](http://cocoapods.org/)**
29
23
30
-
1. In your [Podfile](http://docs.cocoapods.org/podfile.html), add `pod 'TwistedOakCollapsingFutures'`
-[An excellent explanation and motivation for the 'monadic' design of futures (C++)](http://bartoszmilewski.com/2014/02/26/c17-i-see-a-monad-in-your-future/)
44
+
-[Explanation and motivation for the 'monadic' design of futures (in C++)](http://bartoszmilewski.com/2014/02/26/c17-i-see-a-monad-in-your-future/)
52
45
53
46
**Using a Future**
54
47
55
48
The following code is an example of how to make a `TOCFuture`*do* something. Use `thenDo` to make things happen when the future succeeds, and `catchDo` to make things happen when it fails (there's also `finallyDo` for cleanup):
56
49
57
50
```objective-c
58
-
#import"TwistedOakCollapsingFutures.h"
51
+
#import"CollapsingFutures.h"
59
52
60
53
// ask for the address book, which is asynchronous because IOS may ask the user to allow it
@@ -84,7 +77,7 @@ When the result is not known right away, the class `TOCFutureSource` is used. It
84
77
Here's how `asyncGetAddressBook` is implemented:
85
78
86
79
```objective-c
87
-
#import "TwistedOakCollapsingFutures.h"
80
+
#import "CollapsingFutures.h"
88
81
89
82
+(TOCFuture *) asyncGetAddressBook {
90
83
CFErrorRef creationError = nil;
@@ -118,7 +111,7 @@ Here's how `asyncGetAddressBook` is implemented:
118
111
Just creating and using futures is useful, but not what makes them powerful. The true power is in transformative methods like `then:` and `toc_thenAll` that both consume and produce futures. They make wiring up complicated asynchronous sequences look easy:
0 commit comments