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

Add flag to allow active descriptors in listeners #122

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

Add flag to allow active descriptors in listeners #122

wants to merge 5 commits into from

Conversation

fredkilbourn
Copy link
Collaborator

In regards to issue #121:

There are times when listeners might want to make changes that trigger
further events in a collection. I had a bug in my code around this
point and only realized that further collection changes are suppressed
by default. This patch adds an override flag to allow for descriptors
to fire their listeners again even if currently active.

Signed-off-by: Fred Kilbourn [email protected]

There are times when listeners might want to make changes that trigger
further events in a collection.  I had a bug in my code around this
point and only realized that further collection changes are suppressed
by default.  This patch adds an override flag to allow for descriptors
to fire their listeners again even if currently active.

Signed-off-by: Fred Kilbourn <[email protected]>
@fredkilbourn
Copy link
Collaborator Author

Assuming you see validity in my suggestion, it is probably a good idea to add this flag to property-changes.js as well, but let me know.

@kriskowal
Copy link
Member

I have no philosophical objections to this change. When I factored observers into pop-observe, I omitted the feature entirely. If applied, it should be applied consistently across all observer classes.

@marchant
Copy link
Member

allowActive isn't a good make, it should be "allowsActive", but that's not really telling much, allowsNestedDispatch feels more appropriate, please update

fredkilbourn and others added 3 commits June 1, 2015 08:26
- Clean up implementation, update comments
- Also implement in property-changes.js
- Make sure isActive and allowsNestedDispatch keys are defined respective
  get(Map|Property|Range)ChangeDescriptor methods

Signed-off-by: Fred Kilbourn <[email protected]>
@fredkilbourn
Copy link
Collaborator Author

I've updated my branch as follows:

  • Renamed allowsActive to allowsNestedDispatch
  • Implemented in property-changes.js
  • Cleaned up and unified comments + implementations across map-changes, property-changes, range-changes

If this pull does get accepted, will someone be updating the collections.js docs accordingly?

@kriskowal - As a relative outsider, I don't know if I fully understand the context of your comment, but if you plan on tearing out the isActive logic altogether will you just reject my pull and strip that logic out yourself?

@kriskowal
Copy link
Member

@fredkilbourn No, can’t. Backward compatibility across version 1 has to be maintained, and that’s the "latest" tag in npm.

@fredkilbourn
Copy link
Collaborator Author

@kriskowal Okay, I get it. So how's my updated pull request looking now?

@fredkilbourn
Copy link
Collaborator Author

@Stuk, @marchant, @kriskowal: Is there anything that needs to be fixed in this pull? AFAIK it shouldn't have any backwards compatibility issues while adding better control over the nested triggering behavior. Sorry to bump it's just been a number of months now.

@Stuk
Copy link
Contributor

Stuk commented Nov 29, 2015

@fredkilbourn sorry about that, you're right to give us a poke. I no longer have write access to this project, but I would suggest adding some tests for the new functionality so that it's clear that it works, and to ensure that it doesn't get broken in the future.

@hthetiot hthetiot self-requested a review December 7, 2017 04:40
@hthetiot hthetiot added this to the Future milestone Dec 7, 2017
@hthetiot
Copy link
Contributor

hthetiot commented Dec 7, 2017

Can you rebase on master @fredkilbourn ?

@fredkilbourn
Copy link
Collaborator Author

@hthetiot Wow can't believe it's been 2 years! I can fix it up but I'll have to set my environment back up and revisit the code, gimme a little time and I'll get to it.

@hthetiot
Copy link
Contributor

hthetiot commented Dec 7, 2017

@francoisfrisch thanks there is a new test stack on master.

@hthetiot hthetiot modified the milestones: Future, 6.x, 5.0.x, Triage Dec 7, 2017
@hthetiot
Copy link
Contributor

hthetiot commented Dec 7, 2017

you may want to check mergev2 branch (#189) that a work in progress that remove listen in favor of observe. it will be for v6.0.0 release. in the mean time feel free to rebase on master. but that may cause an issue for v6.

@fredkilbourn
Copy link
Collaborator Author

@hthetiot Sincerest apologies, but the project I had this use case for is long defunct and I've really not been using your library for anything else lately, nor do I have the extra time to devote to this (however minor it is).

I'm just letting you know that I'm dropping off this thread and plan to delete my fork of your repo for now. You're welcome to use my code / changes if you want them, but you'll have to finish it yourself. Sorry!

PS - does anyone know if I delete my fork will it mess up this pull request? I can leave it for a while if I need to / you want me to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants