Skip to content

Commit 91d2253

Browse files
committed
Fixing non-reactive data
1 parent e5d4407 commit 91d2253

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

docs/common-patterns.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,18 @@ In summary, you can plan on individual records in the action response data to be
264264

265265
See the [instanceDefaults API](./model-classes.html#instancedefaults)
266266

267+
## Handling Non-Reactive Data
268+
269+
If you are encountering a scenario where certain properties in your records are not reactive, it's probably because they
270+
271+
1. Are not defined in the `instanceDefaults`.
272+
2. Are getting added to the record after it gets added to the Vuex store.
273+
274+
There are two ways to solve this:
275+
276+
1. Add the property to the `instanceDefaults` (see the previous section, above) This tends to be the simplest solution.
277+
2. Make sure the property is added in the responses from the API server.
278+
267279
## Model-Specific Computed Properties
268280

269281
You may find yourself in a position where model-specific computed properties would be very useful. [github issue](https://github.com/feathersjs-ecosystem/feathers-vuex/issues/163). In Feathers-Vuex 1.7, these could be specified in the `instanceDefaults`. As of 2.0, they are specified directly on each Model class:

0 commit comments

Comments
 (0)