From ccdc8326858ddc8c2716feb2ec122e064bcf7914 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sun, 4 Dec 2022 13:27:24 +0300 Subject: [PATCH] docs... Signed-off-by: Alex A. Naanou --- README.md | 38 ++++++++++++++++++++++++++++++++------ package.json | 2 +- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 8339211..8be4b38 100644 --- a/README.md +++ b/README.md @@ -95,8 +95,9 @@ Library of JavaScript type extensions, types and utilities. - [`.as(..)`](#promiseas) - [`.(..)`](#promise-proxymethod) - [Sync/async promise](#syncasync-promise) - - [`Promise.maybe(..)` / `promise.MaybePromice(..)`](#promisemaybe--promisemaybepromice) - - [`.value` / `.error`](#maybe-promisevalue--maybe-promiseerror) + - [`Promise.sync(..)` / `promise.SyncPromice(..)`](#promisesync--promisesyncpromice) + - [`.sync(..)`](#promisesync) + - [`.value` / `.error`](#sync-promisevalue--sync-promiseerror) - [Promise utilities](#promise-utilities) - [`Promise.awaitOrRun(..)`](#promiseawaitorrun) - [Generator extensions and utilities](#generator-extensions-and-utilities) @@ -2009,15 +2010,40 @@ the main `` is resolved. #### `Promise.sync(..)` / `promise.SyncPromice(..)` -XXX +```dnf +Promise.sync() + -> -#### `.value` / `.error` +(, ) + +() + +() +``` + +Implements the full `Promise` protocol but does it in a sync manner, but +the execution of `` is done synchronously. If the value passed to +`(..)` is a promise this will return that and continue asynchronously +otherwise all the promise API (`.then(..)`/`.catch(..)`/...) is run in sync. + + -XXX #### `.sync()` -XXX +Synchronously return the resolved value if `` resolved, and +if it _rejected_ then re-throw the ``. + + +#### `.value` / `.error` + +`` attributes that provide access the resolved `.value` and/or +rejection `.error`. + ### Promise utilities diff --git a/package.json b/package.json index 47ec375..4f0aba5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ig-types", - "version": "6.24.0", + "version": "6.24.1", "description": "Generic JavaScript types and type extensions...", "main": "main.js", "scripts": {