-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sub-props for fillables and guard 🐙 [merge]
- Loading branch information
Showing
20 changed files
with
548 additions
and
116 deletions.
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
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
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
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,58 @@ | ||
--- | ||
home: true | ||
# heroImage: /hero.png | ||
actionText: 始めよう → | ||
actionLink: /setup | ||
features: | ||
- title: 何よりシンプル | ||
details: Minimal setup to get a vuex-module synced with Firestore automatically. | ||
- title: パワフル | ||
details: Easy to use features include filtering, hooks, automatic Firestore Timestamp conversion & much more. | ||
- title: パフォーマンスが第一 | ||
details: Automatic 2-way sync is fully optimised through api call batches. | ||
footer: MIT Licensed | Copyright © 2018-present Luca Ban - Mesqueeb | ||
--- | ||
|
||
# Overview | ||
|
||
たった4つの行のコードを追加するだけで、VuexモジュールがFirestoreと自動的に同期される状態にできる。 | ||
|
||
```js | ||
const userModule = { | ||
firestorePath: 'users/{userId}/data', | ||
firestoreRefType: 'collection', // or 'doc' | ||
moduleName: 'userData', | ||
statePropName: 'docs', | ||
// モジュールのその他 state, actions など | ||
} | ||
// vuex-easy-firestoreでこのuserModuleをvuex pluginとしてstoreに入れるだけ | ||
``` | ||
|
||
and Alakazam! Now you have a vuex module called `userData` with `state: {docs: {}}`. | ||
All firestore documents in your collection will be added with the doc's id as key inside `docs` in your state. | ||
|
||
Now you just update and add docs with `dispatch('userData/set', newItem)` and forget about the rest! | ||
|
||
# Features | ||
|
||
- Complete 2-way sync between your Vuex module & Firestore | ||
- [Automatic Firestore Timestamp conversion](extra-features.html#defaultvalues-set-after-server-retrieval) | ||
- [Fillables](extra-features.html#fillables-and-guard) (limit props able to sync) | ||
- [Hooks](extra-features.html#hooks-before-insert-patch-delete) (before / after sync) | ||
- [Where / orderBy filters](extra-features.html#filters) | ||
|
||
# Motivation | ||
|
||
I didn't like writing an entire an API wrapper from scratch for firestore every single project. If only a vuex module could be in perfect sync with firestore without having to code all the boilerplate yourself... | ||
|
||
And that's how Vuex Easy Firestore was born. | ||
|
||
<div style="text-align: right; margin-bottom: 1rem"><a href="setup.html">Installation and setup</a> →</div> | ||
|
||
# Support | ||
|
||
If you like what I built, you can say thanks by buying me a coffee! :) | ||
|
||
<link href="https://fonts.googleapis.com/css?family=Cookie" rel="stylesheet"><a class="bmc-button" target="_blank" href="https://www.buymeacoffee.com/mesqueeb"><img src="https://www.buymeacoffee.com/assets/img/BMC-btn-logo.svg" alt="Buy me a coffee"><span style="margin-left:5px">Buy me a coffee</span></a> | ||
|
||
Thank you so much!! Every little bit helps. |
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
Oops, something went wrong.