Skip to content

Commit e9aa67b

Browse files
author
Chance Strickland
authored
Merge pull request #4 from skrivle/update-example
update example.
2 parents 826d724 + 9f89d42 commit e9aa67b

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
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

0 commit comments

Comments
 (0)