Platform
Resources
Pricing
Sign in
Get started
Dongkeon Kim
wyd tomorrow? 💁♂️
Workspace
Fork
Published
By
Dongkeon Kim
Edited
May 18, 2020
1 star
Insert cell
Insert cell
{
const
btn
=
DOM
.
element
(
'button'
)
;
btn
.
innerHTML
=
'increment'
;
btn
.
addEventListener
(
"click"
,
(
)
=>
{
store
.
commit
(
'increment'
)
;
}
)
;
return
btn
;
}
Insert cell
store
=
{
Vue
.
use
(
Vuex
)
;
const
initState
=
{
count
:
0
}
;
const
mutations
=
{
increment
(
state
)
{
state
.
count
++
;
}
}
;
return
new
Vuex
.
Store
(
{
state
:
initState
,
mutations
,
plugins
:
[
notiState
]
}
)
;
}
Insert cell
notiState
=
store
=>
{
store
.
subscribe
(
(
mm
,
_state
)
=>
{
mutable
state
=
_state
;
}
)
;
}
Insert cell
mutable
state
=
{
}
Insert cell
Insert cell
import
{
button
}
from
'@jashkenas/inputs'
Insert cell
Vue
=
require
(
'vue'
)
Insert cell
Vuex
=
require
(
'vuex@3.4.0/dist/vuex.js'
)
Insert cell
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Try it for free
Learn more
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
store
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
notiState
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
state
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Vue
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Vuex
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML