# lie **Repository Path**: mirrors_WebReflection/lie ## Basic Information - **Project Name**: lie - **Description**: An optionally sync promise that directly passes along its value. - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-19 - **Last Updated**: 2026-07-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # @webreflection/lie An optionally sync promise that directly passes along its value, particularly useful for any *API* that handles both synchronous and asynchronous use cases through explicit `.then(...)` invocation. ```js import lie from '@webreflection/lie'; // the lie signature: // (value: T) => Thenable lie(123) // invoked synchronously .then(value => { console.log('sync #1', value); return value * 2; }) // invoked synchronously // because the result is an async function // the returned value will be a Promise this time .then(async value => { console.log('sync #2', value); return value * 2; }) // this time is a Promise .then(value => { console.log('async #1', value); }) ; console.log('sync #1 and #2 already logged'); // async #1 going to be logged after ``` **Note**: a `lie(Promise.resolve(123))`, a `lie(lie(123))`, or even a `lie({ then: able })` would simply pass through as result the provided value, as opposite of creating "*lies of lies*".