Skip to content

Commit 45cab5d

Browse files
author
Chance Strickland
committed
Merge branch 'master' of github.com:reach/observe-rect
2 parents 561701d + e9aa67b commit 45cab5d

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,17 @@ import observeRect from "@reach/observe-rect";
3333
let node = document.getElementById("some-node");
3434

3535
let rectObserver = observeRect(node, rect => {
36-
rect.left;
37-
rect.top;
38-
rect.height;
39-
rect.width;
36+
console.log("left", rect.left);
37+
console.log("top", rect.top);
38+
console.log("height", rect.height);
39+
console.log("width", rect.width);
4040
});
41+
42+
// start observing
43+
rectObserver.observe();
44+
45+
// stop observing
46+
rectObserver.unobserve();
4147
```
4248

4349
## About

yarn.lock

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4536,14 +4536,15 @@ [email protected]:
45364536
resolved "https://registry.yarnpkg.com/lodash.unescape/-/lodash.unescape-4.0.1.tgz#bf2249886ce514cda112fae9218cdc065211fc9c"
45374537
integrity sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw=
45384538

4539-
[email protected], lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15:
4539+
[email protected], lodash@^4.17.4:
45404540
version "4.17.15"
45414541
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
45424542
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
45434543

4544-
lodash@^4.17.4:
4545-
version "4.17.10"
4546-
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7"
4544+
lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15:
4545+
version "4.17.15"
4546+
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
4547+
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
45474548

45484549
log-symbols@^2.2.0:
45494550
version "2.2.0"

0 commit comments

Comments
 (0)