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

Addtional Feature Requests #1

Open
Scaremonger opened this issue Sep 14, 2024 · 0 comments
Open

Addtional Feature Requests #1

Scaremonger opened this issue Sep 14, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Scaremonger
Copy link
Contributor

After using the library for a while I have found a few things that would be nice to have:

Observer.once()

  • Provides a one-time response to a message and then the handler is removed

Observer.on( event, self, fn )

  • extended to support callback functions instead of always calling the Observe() method. This is important when you are subscribing to dozens of events because it would remove a large select-case from the Observe() method and should be faster.
  • The self value would be used as an argument to the handler:
    Observer.on( EVENT_SOMETHING, self, CallbackOnSomething )
    Function CallbackOnSomething( event:int, data:object, instance:object )
    EndFunction

Observer.off( self )

  • extended to remove all registered callbacks for self
@Scaremonger Scaremonger added the enhancement New feature or request label Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant