Skip to content

Replace instanceof check with Promise.resolve() in toast.promise - #13

Open
giraugh wants to merge 1 commit into
Gibbu:mainfrom
giraugh:feat/loosen-promise-check
Open

Replace instanceof check with Promise.resolve() in toast.promise#13
giraugh wants to merge 1 commit into
Gibbu:mainfrom
giraugh:feat/loosen-promise-check

Conversation

@giraugh

@giraugh giraugh commented Mar 4, 2025

Copy link
Copy Markdown

Really enjoying using this library but have been experiencing a minor point of friction when using toast.promise(). The problem being that the instanceof Promise check fails for promise-like objects that are not strictly using the Promise class. This PR just swaps the promise check for a Promise.resolve() call which ensures that the value conforms to the promise interface.

But no stress at all if this is not the direction you want to take this method 👍

Cheers!

@Gibbu

Gibbu commented Mar 5, 2025

Copy link
Copy Markdown
Owner

Oooh very nice.
Can you remove the package-json.lock file generated by pnpm? I'll happily merge after that.

@giraugh
giraugh force-pushed the feat/loosen-promise-check branch from 97951d7 to 6604ecc Compare November 12, 2025 04:23
@giraugh

giraugh commented Nov 12, 2025

Copy link
Copy Markdown
Author

Hello! Sorry for the months long delay, I've finally remove that lock file 👍
Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants