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

Deactivate properly #76

Merged
merged 3 commits into from Nov 28, 2017

Conversation

Projects
None yet
1 participant
@50Wliu
Copy link
Member

50Wliu commented Nov 28, 2017

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

Description of the Change

When deactivating, dispose of all subscriptions and remove wrap guide elements from the editor. Previously the only reason why the wrap guide "disappeared" was because its styling was removed - if you had some custom styling for it in your theme or styles.less there was a good chance it would continue to show up even after disabling wrap-guide as the element itself was still present in the DOM.

These changes necessitated converting the editor WeakSet introduced in #71 to an editor -> wrap guide Map.

Alternate Designs

I don't see any alternatives.

Benefits

Proper package deactivation.

Possible Drawbacks

I'd like to say none. I'm still a bit fuzzy on the Map/WeakMap difference but it seems appropriate here to use a Map for the iteration on deactivate. There also shouldn't be a case where the only editor reference is contained in the Map.

Applicable Issues

None.

50Wliu added some commits Nov 28, 2017

@50Wliu 50Wliu force-pushed the wl-deactivate-properly branch from 45216cf to 446cc4e Nov 28, 2017

@50Wliu 50Wliu merged commit 05f79c6 into master Nov 28, 2017

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@50Wliu 50Wliu deleted the wl-deactivate-properly branch Nov 28, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.