Merge branch 'master' into gh-1144

pull/1185/head
Rich Harris 7 years ago
commit 0131216a1a

@ -100,7 +100,7 @@ export function observe(key, callback, options) {
}
export function observeDev(key, callback, options) {
var c = (key = '' + key).search(/[^\w]/);
var c = (key = '' + key).search(/[.[]/);
if (c > -1) {
var message =
'The first argument to component.observe(...) must be the name of a top-level property';

@ -204,7 +204,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
function create_main_fragment(state, component) {
function create_main_fragment(component, state) {
var text, p, text_1, text_2, text_3, slot_content_default = component._slotted["default"], slot_content_default_before, slot_content_default_after;
var foo = new Foo({
@ -270,7 +270,7 @@ function SvelteComponent(options) {
this.slots = {};
this._fragment = create_main_fragment(this._state, this);
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();

@ -1,7 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { appendNode, assign, callAll, createComment, createElement, createFragment, createText, detachNode, init, insertNode, noop, proto, reinsertBetween } from "svelte/shared.js";
function create_main_fragment(state, component) {
function create_main_fragment(component, state) {
var text, p, text_1, text_2, text_3, slot_content_default = component._slotted["default"], slot_content_default_before, slot_content_default_after;
var foo = new Foo({
@ -67,7 +67,7 @@ function SvelteComponent(options) {
this.slots = {};
this._fragment = create_main_fragment(this._state, this);
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();

@ -0,0 +1,25 @@
import { Store } from '../../../../store.js';
const store = new Store({
name: 'world'
});
export default {
store,
html: `<h1>Hello world!</h1>`,
dev: true,
test(assert, component) {
const names = [];
component.observe('$name', name => {
names.push(name);
});
store.set({ name: 'everybody' });
assert.deepEqual(names, ['world', 'everybody']);
}
};
Loading…
Cancel
Save