Closed PlkMarudny closed 2 months ago
Or maybe I use the package incorrectly?
const functionAsync = async (arg) => {
try {
await someAsyncFunction(arg);
return new AsyncResult(Ok(true));
} catch {
return new AsyncResult(Err(false));
}
};
// call the function
const result = await functionAsync("some_argument");
if (result.IsErr()) ... // --- > result.isErr() is not a function
And your account here seems to be hacked, a comment with a link to a binary download from MediaFire appeared shortly.
Hey,
AsyncResult
has neither ok
nor isOk
. May I ask where in the documentation do you see references to either of these in the context of AsyncResult
? Same for isErr
(or IsErr
– you have it misspelled in the example in your second commend). See https://ts-results-es.readthedocs.io/en/latest/reference/asyncresult.html for the AsyncResult
API.
Granted, do we do have some not-yet-released patches in the repository but nothing related to what you're asking about.
And your account here seems to be hacked, a comment with a link to a binary download from MediaFire appeared shortly.
Can you provide any details here? Appeared where?
A comment appeared:
That account is not affiliated with the project.
Can you confirm that the documented AsyncResult
API matches what you're seeing?
I do, my bad. Did not find the example how to use AsyncResult properly.
On Wed, Aug 28, 2024, 16:53 Jakub Stasiak @.***> wrote:
That account is not affiliated with the project.
Can you confirm that the documented AsyncResult API matches what you're seeing?
— Reply to this email directly, view it on GitHub https://github.com/lune-climate/ts-results-es/issues/171#issuecomment-2315238599, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBI252MEQ36NHXMXTMSTATZTXB25AVCNFSM6AAAAABNH7S57KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJVGIZTQNJZHE . You are receiving this because you authored the thread.Message ID: @.***>
I'll close this as I don't think the originally reported problem exists.
Please reopen and provide more information if this is still an issue for you.
I installed v 4.2.0 from the npm registry, but, for example
AsyncResult.isOk()
does not exist, whileAsyncResult.ok
property does. According to documentation, the opposite should happen. Could you have a look?