Commit Graph

254 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
6652ad3d07
Functions that are using KeyPath require !swift(>=5.2) (Guarantee) 2020-01-14 21:59:42 +01:00
Roman Podymov
5fb0714f47
New compactMap, mapValues, compactMapValues, filterValues 2020-01-08 21:10:42 +01:00
Roman Podymov
10c9e75f81
New mapValues, compactMapValues and filterValues 2020-01-08 21:07:59 +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
emrcftci
c864814c1d refactor(*): Change empty tuples to Void 2019-11-13 08:54:47 +03:00
Roman Podymov
10a10ed8bd Promise.value and Guarantee.value when T == Void (#1096)
* Promise.value when T == Void

* Guarantee.value where T == Void

* Replace class with static because Promise is final

* Optimised Guarantee.value where Value == Void

* Add comment

* Implementation with Void()

* Tests for Promise<Void>.value

* Tests for Guarantee<Void>.value

* Added tests for Promise<Void> and Guarantee<Void>
2019-09-25 13:24:39 -04:00
Skoti
93a098f33b correcting and aligning documentation regarding resolve and fulfill usages 2019-08-10 16:56:26 +02:00
Roman Podymov
ee961e1f59
Update AnyPromise.swift 2019-06-28 12:03:32 +02:00
Roman Podymov
0452552590
Update AnyPromise.m 2019-06-28 12:02:03 +02:00
Roman Podymov
fbe6decc6e
Update AnyPromise.h 2019-06-28 12:00:52 +02:00
Igor Palaguta
9f9f1f9e89 Add guarantee sequence utils 2019-06-17 17:45:55 +02:00
Max Howell
74402dcaae Fix for Swift 5 in 4.2 mode on Linux 2019-04-07 12:56:40 -04:00
Max Howell
60215282b6
[travis] Swift 5 GM; Fixes Linux build 2019-03-25 21:37:03 -04:00
Max Howell
69b112b28e
Deprecate promisekit.org
[ci skip]
2019-02-11 19:44:11 -05:00
Max Howell
716f9c2d24 Update documentation links
[skip ci]

Fixes #1008
2019-02-05 15:41:58 -05:00
Max Howell
6264f6f41e Fixes #1001
The box can outlive its Guarantee, and usually this is what happens. Thus we have to log in the box and not in the Guarantee itself.
2019-01-28 15:39:57 -05:00
repo-ranger[bot]
c531710216
Merge pull request #991 from mxcl/fixes-990
Reverts #963 due to ambiguity (see #990)
2019-01-23 23:01:25 +00:00
Max Howell
1c958cfdb6
Reverts #963 due to ambiguity (see #990) 2019-01-23 17:19:00 -05:00
Neal Lester
ecb719a441 Log when unfulfilled guarantee is deallocated
* Fixed bug where pendingPromiseDeallocated event was incorrectly reported as a waitOnMainThread event.
* Now logs if a Guarantee is deallocated before it has been fulfilled.
2019-01-23 14:04:53 -05:00
yifans
3bb8e86c27 docs: fix 'after' docs position 2019-01-19 11:18:24 +08:00
Max Howell
8054c287cf Warnings fixes for Swift 5 2018-12-23 10:44:52 +00:00
Neal Lester
5bb2aae8cc Fixed bug where pendingPromiseDeallocated event was incorrectly repor… (#972)
* Fixed bug where pendingPromiseDeallocated event was incorrectly reported as a waitOnMainThread event. Added test which should have caught this bug in the first place.

* Kick Travis CI
2018-12-14 16:47:17 +00:00
Max Howell
5b72d28396 Rename loggingClosure to logHandler
This is more consistent with Apple API naming.
2018-12-04 15:01:48 -05:00
Max Howell
e9f3df1cab Tidy 2018-12-04 15:01:07 -05:00
Max Howell
b0d3223d98 Rename 2018-12-04 15:00:43 -05:00
Neal Lester
a5ab1ea5b3 Added facilities for controlling console output
Refs #961
2018-12-04 14:48:58 -05:00
Max Howell
4e78705bac Keep code-coverage up; Keep docs coverage up 2018-11-29 12:54:13 -05:00
Lars Stegman
33e7eba60b Create fulfill function for void promises
I find it annoying to have to add a Void value every time I need to fulfill a Void promise. It can also be confusing how to fulfill Void promises for people who are not familiar with how to instantiate a Void value.
2018-11-29 10:14:24 +01:00
Max Howell
a7fea1ba9f
Update Configuration.swift 2018-11-24 17:57:27 -05:00
Max Howell
41699e222d Use final where possible
Allows the optimizer to remove dynamic dispatch, being `public` rather than `open` is not enough.

https://twitter.com/mxcl/status/1060222414829838336
2018-11-07 13:04:01 -05:00
Max Howell
4ff9962082 SKError still is not a real Error, hard-code these
Not ideal, but there’s also no harm in it.
2018-10-02 17:08:38 -04:00
Max Howell
1f3564887e
Clarify when(resolved:) behavior 2018-09-27 13:37:40 -04:00
markus.fassbender
2c44682f44 implement guarantee get 2018-06-27 14:12:09 +02:00
Igor Palaguta
e88d30e150 fix tap documentation comments 2018-06-21 16:41:16 +03:00
Igor Palaguta
59fb55e886 Tap should perform body on specified queue, or on queue from configuration 2018-06-21 16:11:02 +03:00
Max Howell
b96bb7be4b Add firstValue(where:) 2018-06-17 14:10:51 -04:00
Max Howell
6d75d00791 Return the PMKFinalizer from cauterize() 2018-06-17 14:10:51 -04:00
mayurdzk
4b4b30e19a Accept a queue in finally() 2018-06-15 21:17:48 +05:30
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
fd5d23c43d Fix doc comment 2018-06-10 12:32:25 -04:00
Derek Clarkson
bb3b294434 Converting to use a fatalError if an error is actually thrown. 2018-06-10 18:38:27 +10:00
Derek Clarkson
35cdf54a81 Removing throws support as not needed. 2018-06-10 00:01:20 +10:00
Derek Clarkson
89c58298a1 Guarantee then map 2018-06-09 22:27:00 +10:00
Ivanov Anton
2d2729f508
Fixed build error in AnyPromise.m
When installing PromiseKit 6 as a static library via CocoaPods.
The problem is described in the following issue - https://github.com/mxcl/PromiseKit/issues/825.
2018-05-16 17:25:21 +07:00
Geordie J
f31ee94ed6
Fix build issue in hang.swift 2018-05-15 17:58:07 +02:00
Max Howell
52c1d2e26d Complete documentation 2018-05-04 22:25:34 -04:00
Max Howell
14b8506adb Fix ensureThen documentation; Tag 6.2.5 2018-04-20 15:59:52 -04:00
Max Howell
c667ec78cc Add ensureThen
Couldn’t have two variants of `ensure` without the dreaded ambiguity issues.

Sadly Swift cannot infer the type for multiline closures where there are two possible functions for it to match. :(
2018-04-19 21:43:12 -04:00