-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow observing $foo in dev mode - #1181
- Loading branch information
1 parent
805c72f
commit cb8071a
Showing
3 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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']); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<h1>Hello {{$name}}!</h1> |