Skip to content

Commit

Permalink
Move hooks inside 'sync' object in config + Bug fix server hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
mesqueeb committed Jul 1, 2018
1 parent c893b92 commit 5b8ea82
Show file tree
Hide file tree
Showing 20 changed files with 116 additions and 120 deletions.
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ The filters set in `sync: {}` are applied before the DB Channel is openend. They
sync: {
fillables: [],
guard: [],
},
}
}
```

Expand All @@ -244,9 +244,11 @@ May choose not to call this to abort the mutation.
```js
{
// your other config...
insertHook: function (updateStore, doc, store) { updateStore(doc) },
patchHook: function (updateStore, doc, store) { updateStore(doc) },
deleteHook: function (updateStore, id, store) { updateStore(id) },
sync: {
insertHook: function (updateStore, doc, store) { updateStore(doc) },
patchHook: function (updateStore, doc, store) { updateStore(doc) },
deleteHook: function (updateStore, id, store) { updateStore(id) },
}
}
```

Expand Down Expand Up @@ -303,13 +305,12 @@ const firestoreModule = {
orderBy: [],
fillables: [],
guard: [],
// HOOKS for local changes:
insertHook: function (updateStore, doc, store) { return updateStore(doc) },
patchHook: function (updateStore, doc, store) { return updateStore(doc) },
deleteHook: function (updateStore, id, store) { return updateStore(id) },
},

// HOOKS:
insertHook: function (updateStore, doc, store) { return updateStore(doc) },
patchHook: function (updateStore, doc, store) { return updateStore(doc) },
deleteHook: function (updateStore, id, store) { return updateStore(id) },

// When items on the server side are changed:
serverChange: {
defaultValues: {},
Expand Down
41 changes: 20 additions & 21 deletions dist/index.cjs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.cjs.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.cjs.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.cjs.min.js.map

Large diffs are not rendered by default.

41 changes: 20 additions & 21 deletions dist/index.es.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.es.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 5b8ea82

Please sign in to comment.