Skip to content
This repository has been archived by the owner on Jul 30, 2018. It is now read-only.

Fix behavior for multiple nodes with the same root in intersection meta #750

Merged
merged 5 commits into from
Nov 8, 2017

Conversation

maier49
Copy link
Contributor

@maier49 maier49 commented Nov 6, 2017

Type: bug

The following has been addressed in the PR:

  • There is a related issue
  • All code matches the style guide
  • Unit or Functional tests are included in the PR

Description:
The intersection meta would not observe any nodes after the first called for a given options + root combination. This updates the logic so that details is only created once for each options + root combination but each new node requested is observed. A default value for details is provided for each node to avoid observing that node more than once.

Resolves #727

if (!details) {
details = this._createDetails(options, rootNode);
if (!details || !details.entries.get(node)) {
if (!details) {
Copy link
Contributor

Choose a reason for hiding this comment

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

am i missing a subtlety here? (presuming if there isn't any details that there won't be an entry?), could the code not just be:

details = details || this._createDetails(options, rootNode)
if (!details.entries.get(node)) {
    details.entries.set(node, defaultIntersection);
    details.observer.observe(node);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah no reason not to simplify it that way. Code's been updated

@maier49 maier49 merged commit c93a258 into dojo:master Nov 8, 2017
@maier49 maier49 deleted the 727-intersection-meta branch November 8, 2017 17:55
@dylans dylans added this to the beta.4 milestone Jan 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants