Skip to content

Commit c24fc8f

Browse files
committed
Improved observer object and remove dop.observe from the API
1 parent 8c99bc8 commit c24fc8f

File tree

10 files changed

+732
-109
lines changed

10 files changed

+732
-109
lines changed

examples/drag/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

examples/drag/client.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
var server = dop.connect()
33
var circleServer = dop.register({});
44
server.subscribe().into(circleServer)
5-
dop.observe(circleServer, function() {
5+
var observer = dop.createObserver(function() {
66
// We shouldn't update position from others if we are alredy moving it localy
77
if (!circle.mover) {
88
circle.el.style.left = circleServer.x + 'px'
99
circle.el.style.top = circleServer.y + 'px'
1010
}
1111
})
12+
observer.observe(circleServer)
1213
// end dop
1314

1415

0 commit comments

Comments
 (0)