Skip to content

Commit

Permalink
Merge pull request #34 from jonataswalker/v2
Browse files Browse the repository at this point in the history
Release v2
  • Loading branch information
jonataswalker committed Jul 24, 2020
2 parents 27d7e6c + 60268b1 commit 8b8b975
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 140 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,6 @@ watcher.once("scrolling", function(evt) {
watcher.off("scrolling");
```

## Credits

Thanks to [@scottcorgan](https://github.com/scottcorgan) for his great [tiny-emitter](https://github.com/scottcorgan/tiny-emitter).

## License

[MIT](https://github.com/jonataswalker/scroll-watcher/blob/master/LICENSE.md)
127 changes: 2 additions & 125 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 3 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "scroll-watcher",
"version": "1.4.0",
"version": "2.0.0",
"description": "A lightweight, blazing fast, rAF based, scroll watcher.",
"author": "Jonatas Walker",
"homepage": "https://github.com/jonataswalker/scroll-watcher",
"license": "MIT",
"type": "module",
"main": "dist/scroll-watcher.min.js",
"browser": "dist/scroll-watcher.min.js",
"keywords": [
"scroll",
"watcher",
Expand Down Expand Up @@ -44,19 +44,14 @@
"@babel/preset-env"
]
},
"dependencies": {
"raf": "^3.4.1",
"tiny-emitter": "^2.1.0"
},
"dependencies": {},
"devDependencies": {
"@babel/core": "^7.10.5",
"@babel/preset-env": "^7.10.4",
"@rollup/plugin-buble": "^0.21.3",
"ansi-colors": "^4.1.1",
"babel-eslint": "^10.1.0",
"babel-jest": "^26.1.0",
"boxen": "^4.2.0",
"chalk": "^4.1.0",
"eslint": "^7.5.0",
"eslint-config-airbnb-base": "^14.2.0",
"eslint-config-hardcore": "^12.6.0",
Expand Down
4 changes: 2 additions & 2 deletions src/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@ export default function () {
},

on(eventName, callback) {
watchingEmitter.on(eventName, callback, this);
watchingEmitter.on(eventName, callback);

return this;
},

off(eventName, callback) {
watchingEmitter.off(eventName, callback, this);
watchingEmitter.off(eventName, callback);

return this;
},
Expand Down
9 changes: 8 additions & 1 deletion src/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,12 @@ export default function () {

initialize();

return { watch, on: emitter.on, emit: emitter.emit, windowAtBottom, windowAtTop };
return {
watch,
on: emitter.on,
off: emitter.off,
emit: emitter.emit,
windowAtBottom,
windowAtTop,
};
}

0 comments on commit 8b8b975

Please sign in to comment.