Skip to content

Commit

Permalink
documentation fix
Browse files Browse the repository at this point in the history
  • Loading branch information
colxi committed Jul 30, 2018
1 parent 61fa041 commit 989137b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,21 @@ An example of new Observer using all the configuration parameters
{ a : 12 } , // object to abserve
e=>console.log('changed!' , e) , // callback
{
id : 'observed_1', // observable internal id
depth : 5, // observe maximum 6 levels of depth
id : 'observed_1', // observable internal id
depth : 5, // observe maximum 6 levels of depth
observeConstruction : true , // execute callback on construction
ignoreSameValueReassign : false // call callback always
}
);
// because observeConstruction=true, callback fuction is executed...
// console outputs : 'changed!' { action:'add', oldValue:undefined, object:{a:12}, name:'a' }
// console outputs : 'changed!' { action:'add', keypath : 'observed_1.a.' , oldValue:undefined, object:{a:12}, name:'a' }
// perform a modification...
myObserved.a = 14;
// console outputs : 'changed!' { action:'update', keypath : 'observed_1.a.' , oldValue:12, object:{a:14}, name:'a' }
// retrieve the observable...
const sameObserved = Observer('observed-14');
console.log( myObserved, sameObserved );
// console outputs : {a:14} , {a:14}
const sameObserved = Observer('observed_1');
console.log( myObserved === sameObserved );
// console outputs : true
```

## Package distribution :
Expand Down

0 comments on commit 989137b

Please sign in to comment.