ig-types 6.24.0 → 6.24.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +32 -6
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -95,8 +95,9 @@ Library of JavaScript type extensions, types and utilities.
95
95
  - [`<promise>.as(..)`](#promiseas)
96
96
  - [`<promise-proxy>.<method>(..)`](#promise-proxymethod)
97
97
  - [Sync/async promise](#syncasync-promise)
98
- - [`Promise.maybe(..)` / `promise.MaybePromice(..)`](#promisemaybe--promisemaybepromice)
99
- - [`<maybe-promise>.value` / `<maybe-promise>.error`](#maybe-promisevalue--maybe-promiseerror)
98
+ - [`Promise.sync(..)` / `promise.SyncPromice(..)`](#promisesync--promisesyncpromice)
99
+ - [`<promise>.sync(..)`](#promisesync)
100
+ - [`<sync-promise>.value` / `<sync-promise>.error`](#sync-promisevalue--sync-promiseerror)
100
101
  - [Promise utilities](#promise-utilities)
101
102
  - [`Promise.awaitOrRun(..)`](#promiseawaitorrun)
102
103
  - [Generator extensions and utilities](#generator-extensions-and-utilities)
@@ -2009,15 +2010,40 @@ the main `<promise>` is resolved.
2009
2010
 
2010
2011
  #### `Promise.sync(..)` / `promise.SyncPromice(..)`
2011
2012
 
2012
- XXX
2013
+ ```dnf
2014
+ Promise.sync(<func>)
2015
+ -> <sync-promise>
2013
2016
 
2014
- #### `<sync-promise>.value` / `<sync-promise>.error`
2017
+ <func>(<resolve>, <reject>)
2018
+
2019
+ <resolve>(<value>)
2020
+
2021
+ <reject>(<error>)
2022
+ ```
2023
+
2024
+ Implements the full `Promise` protocol but does it in a sync manner, but
2025
+ the execution of `<func>` is done synchronously. If the value passed to
2026
+ `<resolve>(..)` is a promise this will return that and continue asynchronously
2027
+ otherwise all the promise API (`.then(..)`/`.catch(..)`/...) is run in sync.
2028
+
2029
+ <!--
2030
+ Example:
2031
+ ```javascript
2032
+ ```
2033
+ -->
2015
2034
 
2016
- XXX
2017
2035
 
2018
2036
  #### `<promise>.sync()`
2019
2037
 
2020
- XXX
2038
+ Synchronously return the resolved value if `<sync-promise>` resolved, and
2039
+ if it _rejected_ then re-throw the `<error>`.
2040
+
2041
+
2042
+ #### `<sync-promise>.value` / `<sync-promise>.error`
2043
+
2044
+ `<sync-promise>` attributes that provide access the resolved `.value` and/or
2045
+ rejection `.error`.
2046
+
2021
2047
 
2022
2048
 
2023
2049
  ### Promise utilities
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ig-types",
3
- "version": "6.24.0",
3
+ "version": "6.24.1",
4
4
  "description": "Generic JavaScript types and type extensions...",
5
5
  "main": "main.js",
6
6
  "scripts": {