mirror of https://github.com/sveltejs/svelte
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
350 B
18 lines
350 B
8 years ago
|
<div>{{foo.x}}</div>
|
||
|
|
||
|
<script>
|
||
|
export default {
|
||
8 years ago
|
oncreate () {
|
||
8 years ago
|
this.observe( 'foo', foo => {
|
||
|
const bar = this.get( 'bar' );
|
||
|
if ( foo.x !== bar.x ) throw new Error( 'mismatch' );
|
||
|
});
|
||
|
|
||
|
this.observe( 'bar', bar => {
|
||
|
const foo = this.get( 'foo' );
|
||
|
if ( foo.x !== bar.x ) throw new Error( 'mismatch' );
|
||
|
});
|
||
|
}
|
||
|
};
|
||
|
</script>
|