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

Dynamic Event Registration #58

Merged
merged 5 commits into from
Jan 3, 2021
Merged

Dynamic Event Registration #58

merged 5 commits into from
Jan 3, 2021

Conversation

da-h
Copy link
Owner

@da-h da-h commented Dec 30, 2020

Dynamic Event Registration

This PR enables any event to itself append to existing events or even overwriting existing events.

To accomplish this, this PR does the following:

  • mf (the same object as is used during register(mf) to the list of possible arguments that are automatically determined and passed to an event upon execution
  • mf.overwrite_event to redefine previous definitions completely
  • mf.register_event clears the cache of the event-object automatically
  • adds a simple test case for event registration during an event

@da-h da-h requested a review from sbrodehl December 30, 2020 15:57
@da-h da-h added this to the v2.0 milestone Dec 30, 2020
@da-h da-h linked an issue Dec 30, 2020 that may be closed by this pull request
Copy link
Collaborator

@sbrodehl sbrodehl left a comment

Choose a reason for hiding this comment

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

Here is my feedback:

  • Is the mf variable automatically added as an argument like state and event?
  • How can one unregister an event?

@da-h
Copy link
Owner Author

da-h commented Dec 31, 2020

  • correct mf is an optional, automatically passed argument as state and event
  • is un-registration a desired feature? if so, it would be easy to make the api public. The function is already present in this PR.

@sbrodehl
Copy link
Collaborator

I think un-registration might come in handy.

@da-h
Copy link
Owner Author

da-h commented Jan 3, 2021

I think un-registration might come in handy.

Done.

@da-h da-h requested a review from sbrodehl January 3, 2021 12:30
@da-h da-h merged commit b2ec4dc into v2-dev Jan 3, 2021
@da-h da-h deleted the event_register_in_event branch January 3, 2021 12:43
da-h added a commit that referenced this pull request Jan 3, 2021
da-h added a commit that referenced this pull request Jan 4, 2021
da-h added a commit that referenced this pull request Jan 4, 2021
@da-h da-h mentioned this pull request Jul 26, 2021
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.

redefine events from within an event call
2 participants