Commit Graph

20 Commits

Author SHA1 Message Date
Nora Trapp
d3fbd490a4 Maintain queue through chain completion 2021-08-25 21:33:10 -07:00
Roman Podymov
8fd461350f
Functions that are using KeyPath require !swift(>=5.2) (Thenable) 2020-01-14 22:01:01 +01:00
Roman Podymov
5fb0714f47
New compactMap, mapValues, compactMapValues, filterValues 2020-01-08 21:10:42 +01:00
Roman Podymov
f8a593a320 Map by keyPath (#1118)
* Added func map<U>(_ keyPath: KeyPath<T, U>)

* Added swift version

* Added func map<U>(_ keyPath: KeyPath<T, U>)

* testMap

* testMap for Guarantee

* Added missing __allTests__GuaranteeTests

* Added all missing tests

* Removed #if swift

* Tests ordering

* Fixed tests
2020-01-07 17:02:16 +00:00
Skoti
93a098f33b correcting and aligning documentation regarding resolve and fulfill usages 2019-08-10 16:56:26 +02:00
Igor Palaguta
9f9f1f9e89 Add guarantee sequence utils 2019-06-17 17:45:55 +02:00
Igor Palaguta
e88d30e150 fix tap documentation comments 2018-06-21 16:41:16 +03:00
Max Howell
b96bb7be4b Add firstValue(where:) 2018-06-17 14:10:51 -04:00
Max Howell
d427b29dd7 Allow specifying DispatchWorkItemFlags; Tag 6.3.0
This has recently become useful to me, though this is for experienced users only.
2018-06-10 13:24:26 -04:00
Max Howell
52c1d2e26d Complete documentation 2018-05-04 22:25:34 -04:00
Colin T.A. Gray
6f20a190c3 Allow setting nil for conf.Q 2018-04-04 23:21:26 -04:00
Max Howell
06ff4333b9 Documentation++ 2018-02-25 13:40:00 -05:00
Lois Di Qual
47b6db3a50 Fix param names 2018-02-24 20:18:24 -08:00
Lois Di Qual
97de95190b Document then/map/done/get 2018-02-24 20:00:25 -08:00
Max Howell
d2f37908a3 Provide specific error for this condition 2018-02-19 10:26:32 -05:00
Max Howell
5e14f2d7f8 Subsequent handlers should dispatch to nil 2018-02-19 10:26:31 -05:00
Max Howell
5cd9fd05a0
Rename functional functions; Refs #773
Rename functional functions; Refs #773

See the discussion in #773 and #782 for details.

| Form | Currently | Proposed |
|-------------------------------------------|---------|------------|
| `Promise<T> => ((T) -> U?) => Promise<U>` | flatMap | compactMap |
| `Promise<[T]> => ((T) -> U) => Promise<[U]>` | map | mapValues |
| `Promise<[T]> => ((T) -> [U]) => Promise<[U]>)` | flatMap | flatMapValues |
| `Promise<[T]> => ((T) => U?)` | compactMap | compactMapValues |
| `Promise<[T]> => ((T) -> Promise<U>) => Promise<[U]>` | thenMap | *unchanged* |
| `Promise<[T]> => ((T) -> Promise<[U]>) => Promise<[U]>` | thenFlatMap | *unchanged* |
| `Promise<[T]> => ((T) -> Bool) => Promise<[T]>` | filter | filterValues |
| `Promise<[T]> => Promise<T>` | last | lastValue |
2018-02-19 10:24:59 -05:00
Max Howell
59847871ba Xcode 9.3 / Swift 4.1 / Swift 3.3 updates
Strictly I’d feel better to test all configurations, but PromiseKit only uses Foundation, so the chance that for some reason there is an API break or worse some kind of runtime issue is pretty low and I feel that we have to be kinder to Travis’s free infrastructure.

Tag 6.0.2
2018-02-16 15:26:52 -05:00
Max Howell
17587be4ac PromiseKit 6.0.0
This because `Promise(value:)` is selected for PMK-4’s pending initializer due to trailing closure syntax and the fact that `T` could be anything. I guess this isn’t a Swift bug, but geez.

This is a real problem for people migrating to 5 from 4, such that I have decided 5 must be deprecated.

The severity is due to Swift giving a very misleading error diagnostic when it uses `Promise(value:)`, because as you can guess you end up with:

    Promise<(T->Void, Error->Void)>

As your inferred type.

Because we no longer have ambiguity between `Promise { seal in` and `Promise(value:` I have removed the `.pending` parameter for that usage which will also aid migration.

In some cases this leads to less nice code, but mostly it’s fine due to being able to do `.value(1)` where `Promise` can be inferred. The trade off is worth it though as PromiseKit should be delightful to use and as it stands, it is a pain due to how Swift is.
2018-02-10 17:23:27 -05:00
Max Howell
47367f1df6 5.0.0 2017-11-06 09:27:11 -05:00