Skip to content

Conversation

@esidegallery
Copy link

It's sometimes necessary, or at least useful to check whether a promise signal has already been dispatched.

Tim John added 2 commits February 24, 2017 12:29
It's sometimes necessary, or at least useful to check whether a promise signal has already been dispatched.
Promise.isDispatched now exposed as read-only var
@esidegallery esidegallery changed the title Promise.isDispatched now exposed as read-only var Promise.isDispatched now exposed as read-only property Feb 27, 2017
if (_isDispatched)
{
throw new IllegalOperationError("You cannot dispatch() a Promise more than once");
if (!ignoreSubsequentDipatches)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just use a OnceSignal?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't aware I was submitting this as a pull request! I'm using promises for their retroactive dispatch functionality, and was sometimes getting runtime errors as promises sometimes got dispatched more than once. This just got around that issue.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Promise now implements IPriorityOnceSignal.
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.

3 participants