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

New API methods including invalidate and custom roots #25

Merged
merged 2 commits into from
Jun 12, 2018
Merged

Conversation

lynchbomb
Copy link
Collaborator

@lynchbomb lynchbomb commented Mar 22, 2018

This spike compliments (linkedin/spaniel#80). We will need to deploy this behind a minor version bump and feature flag.

This PR includes the following new API method:

  • invalidate

Additionally:

  • Includes the ability to watch a custom root within onInViewportOnce and an optional flag ALLOW_CACHED_SCHEDULER.
  • Bumps Spaniel to v2.5.0

@lynchbomb
Copy link
Collaborator Author

@stefanpenner ^^^^^

@lynchbomb
Copy link
Collaborator Author

!Not ready to merge until a new release of Spaniel v2.5.0 is rolled out.

@lynchbomb lynchbomb changed the title New API methods and Spaniel force revalidate New API methods including invalidate and custom roots May 15, 2018
@lynchbomb lynchbomb force-pushed the lynchbomb branch 4 times, most recently from 01e2755 to 0c378eb Compare May 29, 2018 17:38
@lynchbomb
Copy link
Collaborator Author

This PR is ready to merge. Spaniel v2.5.0 is released.

spaniel.invalidate();
},

on(eventName, callback, root = window) {

Choose a reason for hiding this comment

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

what does this API have to do with this service? it doesn't look like it belongs here at all.

Copy link
Collaborator Author

@lynchbomb lynchbomb Jun 12, 2018

Choose a reason for hiding this comment

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

The intention was succinct abstract event binding methods to be called on the ember-spaniel viewport directly with an argument to specify a root. The use-case is to call spaniel.invalidate(). Im totally cool with removing on/off/onDebouce from the API (this PR) and rather just documenting the implementation via leveraging existing API's.

The key changes are invalidate and ALLOW_CACHED_SCHEDULER.

Same answer for:

there is already a run.debounce util in ember itself. also, this doesn't not use anything in the service and does not seem like it has to do with spaniel.

Choose a reason for hiding this comment

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

lets pull on/off/onDebounce outside of this, just document suggested use of other apis. otherwise looks good to me

root.removeEventListener(eventName, callback, false);
},

onDebounce(eventName, callback, interval, root = window) {

Choose a reason for hiding this comment

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

there is already a run.debounce util in ember itself. also, this doesn't not use anything in the service and does not seem like it has to do with spaniel.

@lynchbomb lynchbomb merged commit 46f3323 into master Jun 12, 2018
@lynchbomb lynchbomb deleted the lynchbomb branch June 12, 2018 21:46
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.

2 participants