mirror of https://github.com/sveltejs/svelte
parent
daa2635cd3
commit
2f86bd339d
@ -1,7 +0,0 @@
|
||||
export default {
|
||||
dev: true,
|
||||
|
||||
error ( assert, err ) {
|
||||
assert.equal( err.message, `The first argument to component.observe(...) must be the name of a top-level property, i.e. 'nested' rather than 'nested.data'` );
|
||||
}
|
||||
};
|
@ -1,9 +0,0 @@
|
||||
<script>
|
||||
export default {
|
||||
oncreate () {
|
||||
this.observe( 'nested.data', data => {
|
||||
console.log( 'nope' );
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,7 +0,0 @@
|
||||
export default {
|
||||
dev: true,
|
||||
|
||||
warnings: [
|
||||
`Return 'destroy()' from custom event handlers. Returning 'teardown()' has been deprecated and will be unsupported in Svelte 2`
|
||||
]
|
||||
};
|
@ -1,16 +0,0 @@
|
||||
<button on:foo='foo()'>foo</button>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
methods: {
|
||||
foo() {}
|
||||
},
|
||||
events: {
|
||||
foo(node, callback) {
|
||||
return {
|
||||
teardown() {}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,7 +0,0 @@
|
||||
export default {
|
||||
dev: true,
|
||||
|
||||
warnings: [
|
||||
`Use component.on('destroy', ...) instead of component.on('teardown', ...) which has been deprecated and will be unsupported in Svelte 2`
|
||||
]
|
||||
};
|
@ -1,9 +0,0 @@
|
||||
<script>
|
||||
export default {
|
||||
oncreate () {
|
||||
this.on( 'teardown', () => {
|
||||
this.destroyed = true;
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,7 +1,7 @@
|
||||
export default {
|
||||
test ( assert, component ) {
|
||||
assert.equal( component.get('a'), 1 );
|
||||
assert.equal( component.get('c'), 3 );
|
||||
assert.equal( component.get().a, 1 );
|
||||
assert.equal( component.get().c, 3 );
|
||||
assert.deepEqual( component.get(), { a: 1, b: 2, c: 3 });
|
||||
}
|
||||
};
|
||||
|
@ -1,17 +0,0 @@
|
||||
<div>{{foo.x}}</div>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
oncreate () {
|
||||
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>
|
@ -0,0 +1,13 @@
|
||||
<div>{{foo.x}}</div>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
onstate({ current, changed }) {
|
||||
if (changed.foo || changed.bar) {
|
||||
if (current.foo.x !== current.bar.x) {
|
||||
throw new Error('mismatch');
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue