Skip to content

Commit

Permalink
Default values for local changes 📐[merge]
Browse files Browse the repository at this point in the history
  • Loading branch information
mesqueeb authored Dec 16, 2018
2 parents 5abd35f + 4559feb commit 9dae28c
Show file tree
Hide file tree
Showing 34 changed files with 800 additions and 860 deletions.
175 changes: 75 additions & 100 deletions dist/index.cjs.js

Large diffs are not rendered by default.

175 changes: 75 additions & 100 deletions dist/index.esm.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ module.exports = {
sidebar: [
['/setup', 'Installation & setup'],
'/guide',
'/extra-features',
'/firestore-fields-and-functions',
'/hooks',
'/extra-features',
'/config-example',
'/feedback',
],
Expand Down
9 changes: 5 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ features:
- title: Simplicity First
details: Minimal setup to get a vuex-module synced with Firestore automatically.
- title: Powerful
details: Easy to use features include filtering, hooks, automatic Firestore Timestamp conversion & much more.
details: Easy to use features include filtering, hooks, default values, automatic Firestore Timestamp conversion & much more.
- title: Performant
details: Automatic 2-way sync is fully optimised through api call batches.
footer: MIT Licensed | Copyright © 2018-present Luca Ban - Mesqueeb
Expand Down Expand Up @@ -36,10 +36,11 @@ Now you just update and add docs with `dispatch('userData/set', newItem)` and fo
# Features

- Automatic 2-way sync between your Vuex module & Firestore
- [Timestamp conversion to Date()](extra-features.html#defaultvalues-set-after-server-retrieval)
- [Default values](extra-features.html#default-values)
- [Hooks](hooks.html#hooks) (before / after sync)
- [Fillables / guard](extra-features.html#fillables-and-guard) (limit fields which will sync)
- [Hooks](extra-features.html#hooks-before-insert-patch-delete) (before / after sync)
- [Where / orderBy filters](extra-features.html#filters)
- [Timestamp conversion to Date()](extra-features.html#firestore-timestamp-conversion)
- [Where / orderBy filters](guide.html#query-data-filters)

# Motivation

Expand Down
3 changes: 2 additions & 1 deletion docs/config-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const firestoreModule = {
orderBy: [],
fillables: [],
guard: [],
defaultValues: {},
// HOOKS for local changes:
insertHook: function (updateStore, doc, store) { return updateStore(doc) },
patchHook: function (updateStore, doc, store) { return updateStore(doc) },
Expand All @@ -31,7 +32,7 @@ const firestoreModule = {

// When docs on the server side are changed:
serverChange: {
defaultValues: {},
convertTimestamps: {},
// HOOKS for changes on SERVER:
addedHook: function (updateStore, doc, id, store) { return updateStore(doc) },
modifiedHook: function (updateStore, doc, id, store) { return updateStore(doc) },
Expand Down
Loading

0 comments on commit 9dae28c

Please sign in to comment.