Conversation
|
@stefanpenner ^^^^^ |
d92c789 to
7f580ff
Compare
|
!Not ready to merge until a new release of Spaniel v2.5.0 is rolled out. |
01e2755 to
0c378eb
Compare
|
This PR is ready to merge. Spaniel v2.5.0 is released. |
addon/services/viewport.js
Outdated
| spaniel.invalidate(); | ||
| }, | ||
|
|
||
| on(eventName, callback, root = window) { |
There was a problem hiding this comment.
what does this API have to do with this service? it doesn't look like it belongs here at all.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
lets pull on/off/onDebounce outside of this, just document suggested use of other apis. otherwise looks good to me
addon/services/viewport.js
Outdated
| root.removeEventListener(eventName, callback, false); | ||
| }, | ||
|
|
||
| onDebounce(eventName, callback, interval, root = window) { |
There was a problem hiding this comment.
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.
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:
invalidateAdditionally:
onInViewportOnceand an optional flagALLOW_CACHED_SCHEDULER.