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.
svelte/test/runtime/samples/set-in-observe-dedupes-renders/main.html

25 lines
310 B

<Widget foo='{{foo}}' bar='{{bar}}'/>
<script>
import Widget from './Widget.html';
export default {
data () {
return {
foo: { x: 1 },
bar: { x: 1 }
}
},
oncreate () {
this.observe( 'foo', foo => {
this.set({ bar: foo });
});
},
components: {
Widget
}
};
</script>