File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -55,11 +55,15 @@ export default function makeFindMixin(options) {
55
55
const ERROR = `${ prefix } Error`
56
56
const GET_ACTION = `get${ capitalized } `
57
57
const GET_GETTER = `get${ capitalized } FromStore`
58
+ const HAS_ITEM_BEEN_REQUESTED_ONCE = `has${ capitalized } BeenRequestedOnce`
59
+ const HAS_ITEM_LOADED_ONCE = `has${ capitalized } LoadedOnce`
58
60
const LOCAL = `${ prefix } Local`
59
61
const QID = `${ prefix } Qid`
60
62
const ID = `${ prefix } Id`
61
63
const data = {
62
64
[ IS_GET_PENDING ] : false ,
65
+ [ HAS_ITEM_BEEN_REQUESTED_ONCE ] : false ,
66
+ [ HAS_ITEM_LOADED_ONCE ] : false ,
63
67
[ WATCH ] : watch ,
64
68
[ QID ] : qid ,
65
69
[ ERROR ] : null
@@ -94,6 +98,7 @@ export default function makeFindMixin(options) {
94
98
if ( ! this [ LOCAL ] ) {
95
99
if ( this [ QUERY_WHEN ] ) {
96
100
this [ IS_GET_PENDING ] = true
101
+ this [ HAS_ITEM_BEEN_REQUESTED_ONCE ] = true
97
102
98
103
if ( idToUse != null ) {
99
104
return this . $store
@@ -102,6 +107,7 @@ export default function makeFindMixin(options) {
102
107
// To prevent thrashing, only clear ERROR on response, not on initial request.
103
108
this [ ERROR ] = null
104
109
110
+ this [ HAS_ITEM_LOADED_ONCE ] = true
105
111
this [ IS_GET_PENDING ] = false
106
112
return response
107
113
} )
You can’t perform that action at this time.
0 commit comments