Skip to content

Commit b243919

Browse files
committed
Complete useFind documentation
1 parent a687167 commit b243919

File tree

8 files changed

+203
-35
lines changed

8 files changed

+203
-35
lines changed

docs/2.0-major-release.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ export default new Vuex.Store({
286286

287287
With the above four steps accomplished, the base of most any application using `feathers-vuex` is ready to build something awesome!
288288

289-
## FeathersVuex Vue plugin changes
289+
## Feathers-Vuex Vue plugin changes
290290

291291
The Vue plugin is registered in exactly the same way. The difference comes when you try to find the Model classes in the `$FeathersVuex` object. Instead of finding models directly on the `$FeathersVuex` object, they are namespaced by the `serverAlias` you provided. This allows cleaner support for multiple APIs. Supposing you had this code in a component, previously...
292292

docs/composition-api.md

Lines changed: 169 additions & 27 deletions
Large diffs are not rendered by default.

docs/data-components.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
title: Renderless Data Components
33
---
44

5+
# Renderless Data Components
6+
57
There are two new renderless data provider components: `<FeathersVuexFind>` and `<FeathersVuexGet>`. They simplify performing queries against the store and/or the API server. They make the data available inside each component's default slot.
68

79
To see why you might want to use these components, below are two example components that are functionally equivalent.
@@ -85,7 +87,7 @@ These components use Vuex getters (to query data from the local store) and actio
8587

8688
## Registering the components
8789

88-
These components are automatically registered globally when using the FeathersVuex Vue plugin.
90+
These components are automatically registered globally when using the Feathers-Vuex Vue plugin.
8991

9092
If you prefer to manually register the component, pass `{ components: false }` as options when using the FeathersVuex Vue plugin, then do the following:
9193

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
home: true
33
heroImage: https://github.com/feathersjs-ecosystem/feathers-vuex/raw/master/service-logo.png
4-
heroText: FeathersVuex 2.x
4+
heroText: Feathers-Vuex 3.x
55
tagLine: Integration of FeathersJS, Vue, and Nuxt for the artisan developer
66
actionText: Get Started
77
actionLink: ./api-overview.md

docs/mixins.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@
22
title: Mixins
33
---
44

5-
> Coming in Version 2.0: First Class pagination support! Details coming soon.
5+
# Mixins
66

7-
FeathersVuex mixins provide quick and easy best practices directly inside a component's viewModel. They are similar to [Renderless Data Components](./components.md), but are more powerful for two reasons.
7+
`Feathers-Vuex` mixins provide quick and easy best practices directly inside a component's viewModel. They are similar to [Renderless Data Components](./components.md), but are more powerful for two reasons.
88

99
1. You can do lots of them together. Handle multiple queries against multiple services at the same time. The Renderless Data Components aren't capable of handling more than one query without doing ugly nesting.
1010
2. They bring the data directly into the component's actual viewModel. The Renderless Data Components only pull the data into the template scope, so the only clean way to get access to the data was by passing it to a component as props. This is a great solution until you run into number 1, above.
1111

12-
Here are the steps to using it:
12+
If you're not using the [Feathers-Vuex Composition API](./composition-api.md), the mixins are probably going to be your preferred solution for development.
13+
14+
## Usage
15+
16+
Here are the steps to using mixins:
1317

1418
1. Import the `makeFindMixin` utility from FeathersVuex.
1519
2. Register it in a component's mixins once for each query to be made in the component.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@
171171
"ts-node": "^8.5.2",
172172
"typescript": "^3.7.2",
173173
"vue": "^2.6.11",
174+
"vue-server-renderer": "^2.6.11",
174175
"vue-template-compiler": "^2.6.11",
175176
"vuepress": "^1.2.0",
176177
"vuex": "^3.1.2"

src/useFind.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export default function find(options: UseFindOptions): UseFindData {
104104
const skip = getterParams.query.$skip || defaultSkip
105105
const limit = getterParams.query.$limit || defaultLimit
106106
const pagination =
107-
computes.paginationData[getterParams.qid || state[qid]] || {}
107+
computes.paginationData[getterParams.qid || state.qid] || {}
108108
const response = skip != null && limit != null ? { limit, skip } : {}
109109
const queryInfo = getQueryInfo(getterParams, response)
110110
const items = getItemsFromQueryInfo(

yarn.lock

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7364,7 +7364,7 @@ lodash.sortby@^4.7.0:
73647364
resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438"
73657365
integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=
73667366

7367-
lodash.template@^4.4.0:
7367+
lodash.template@^4.4.0, lodash.template@^4.5.0:
73687368
version "4.5.0"
73697369
resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.5.0.tgz#f976195cf3f347d0d5f52483569fe8031ccce8ab"
73707370
integrity sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==
@@ -9968,6 +9968,11 @@ serialize-javascript@^1.3.0, serialize-javascript@^1.7.0:
99689968
resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.9.1.tgz#cfc200aef77b600c47da9bb8149c943e798c2fdb"
99699969
integrity sha512-0Vb/54WJ6k5v8sSWN09S0ora+Hnr+cX40r9F170nT+mSkaxltoE/7R3OrIdBSUv1OoiobH1QoWQbCnAO+e8J1A==
99709970

9971+
serialize-javascript@^2.1.2:
9972+
version "2.1.2"
9973+
resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-2.1.2.tgz#ecec53b0e0317bdc95ef76ab7074b7384785fa61"
9974+
integrity sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ==
9975+
99719976
serve-index@^1.9.1:
99729977
version "1.9.1"
99739978
resolved "https://registry.yarnpkg.com/serve-index/-/serve-index-1.9.1.tgz#d3768d69b1e7d82e5ce050fff5b453bea12a9239"
@@ -11512,6 +11517,20 @@ vue-server-renderer@^2.6.10:
1151211517
serialize-javascript "^1.3.0"
1151311518
source-map "0.5.6"
1151411519

11520+
vue-server-renderer@^2.6.11:
11521+
version "2.6.11"
11522+
resolved "https://registry.yarnpkg.com/vue-server-renderer/-/vue-server-renderer-2.6.11.tgz#be8c9abc6aacc309828a755c021a05fc474b4bc3"
11523+
integrity sha512-V3faFJHr2KYfdSIalL+JjinZSHYUhlrvJ9pzCIjjwSh77+pkrsXpK4PucdPcng57+N77pd1LrKqwbqjQdktU1A==
11524+
dependencies:
11525+
chalk "^1.1.3"
11526+
hash-sum "^1.0.2"
11527+
he "^1.1.0"
11528+
lodash.template "^4.5.0"
11529+
lodash.uniq "^4.5.0"
11530+
resolve "^1.2.0"
11531+
serialize-javascript "^2.1.2"
11532+
source-map "0.5.6"
11533+
1151511534
vue-style-loader@^4.1.0:
1151611535
version "4.1.2"
1151711536
resolved "https://registry.yarnpkg.com/vue-style-loader/-/vue-style-loader-4.1.2.tgz#dedf349806f25ceb4e64f3ad7c0a44fba735fcf8"

0 commit comments

Comments
 (0)