Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
simplevuestore
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Adam Procter
simplevuestore
Commits
9eaae0f3
Commit
9eaae0f3
authored
Apr 11, 2019
by
Adam Procter
💩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updates
parent
ef3736b5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
src/store.js
src/store.js
+0
-3
src/views/Home.vue
src/views/Home.vue
+12
-9
No files found.
src/store.js
View file @
9eaae0f3
...
...
@@ -32,14 +32,12 @@ const store = new Vuex.Store({
},
actions
:
{
SYNC_DB
()
{
console
.
log
(
'
sync
'
)
pouchdb
.
sync
(
remote
,
{
live
:
true
,
retry
:
true
})
},
CHANGES_DBSIDE
()
{
console
.
log
(
'
yo
'
)
// call mutation when you hear DB changes
pouchdb
.
changes
({
since
:
'
now
'
,
...
...
@@ -82,7 +80,6 @@ const store = new Vuex.Store({
pouchdb
.
put
({
_id
:
id
,
flavour
:
event
})
}
})
store
.
dispatch
(
'
CHANGES_DBSIDE
'
)
}
},
...
...
src/views/Home.vue
View file @
9eaae0f3
...
...
@@ -10,6 +10,10 @@
const
CLEAR_STATE
=
'
CLEAR_STATE
'
import
EntryForm
from
'
@/components/EntryForm.vue
'
import
DisplayText
from
'
@/components/DisplayText.vue
'
import
PouchDB
from
'
pouchdb
'
var
pouchdb
=
new
PouchDB
(
'
icecream
'
)
var
remote
=
'
https://nn.adamprocter.co.uk/icecream
'
export
default
{
name
:
'
entryform
'
,
...
...
@@ -27,15 +31,14 @@ export default {
},
//any mutations are put into the stepfwd array
created
()
{
this
.
$store
.
dispatch
(
'
CHANGES_DBSIDE
'
),
this
.
$store
.
subscribe
(
mutation
=>
{
if
(
mutation
.
type
!==
CLEAR_STATE
)
{
this
.
stepfwd
.
push
(
mutation
)
}
if
(
this
.
newMutation
)
{
this
.
stepback
=
[]
}
})
this
.
$store
.
subscribe
(
mutation
=>
{
if
(
mutation
.
type
!==
CLEAR_STATE
)
{
this
.
stepfwd
.
push
(
mutation
)
}
if
(
this
.
newMutation
)
{
this
.
stepback
=
[]
}
})
},
methods
:
{
fwd
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment