Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promise.isDispatched now exposed as read-only property #72

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

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
@@ -50,7 +53,10 @@ package org.osflash.signals
{
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.

2 participants