-
Notifications
You must be signed in to change notification settings - Fork 201
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
base: master
Are you sure you want to change the base?
Conversation
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
…hing when dispatching more than once.
src/org/osflash/signals/Promise.as
Outdated
@@ -50,7 +53,10 @@ package org.osflash.signals | |||
{ | |||
if (_isDispatched) | |||
{ | |||
throw new IllegalOperationError("You cannot dispatch() a Promise more than once"); | |||
if (!ignoreSubsequentDipatches) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Promise now implements IPriorityOnceSignal.
It's sometimes necessary, or at least useful to check whether a promise signal has already been dispatched.