Properties
busyChecklist
busyChecklist: boolean = false
checklist
Optional chunkFolder
chunkFolder: string
Optional chunks
chunks: Record<string, string[]>
fetchChecklist
fetchChecklist: () => Promise<void> = flow(function* (this: ChecklistStore) {this.busyChecklist = true;try {this.checklist = yield request<RequestRouteChecklistGet,ParamsRouteChecklistGet,ResponseRouteChecklistGet>({location: locationRestChecklistGet,params: {_wp_http_referer: window.location.href}});} catch (e) {console.log(e);throw e;} finally {this.busyChecklist = false;}})
probablyFetchByChangedItem
probablyFetchByChangedItem: (itemId: string | string[], force?: boolean) => Promise<void> = flow(function* (this: ChecklistStore,itemId,force) {if (force) {yield this.fetchChecklist();return;}const useItemIds = !Array.isArray(itemId) ? [itemId] : itemId;if (this.items.filter(({ id, checked }) => useItemIds.indexOf(id) > -1 && !checked).length > 0) {yield this.fetchChecklist();}})
Type declaration
-
- (itemId: string | string[], force?: boolean): Promise<void>
-
Parameters
-
itemId: string | string[]
-
Optional force: boolean
Returns Promise<void>
Optional publicUrl
publicUrl: string
Optional restNamespace
restNamespace: string
Optional restNonce
restNonce: string
Optional restQuery
restQuery: {}
Optional restRecreateNonceEndpoint
restRecreateNonceEndpoint: string
Optional restRoot
restRoot: string
Optional restUrl
restUrl: string
Readonly rootStore
textDomain
textDomain: string
toggleChecklistItem
toggleChecklistItem: (id: string, state: boolean) => Promise<void> = flow(function* (this: ChecklistStore,id,state) {this.busyChecklist = true;try {this.checklist = yield request<RequestRouteChecklistPut,ParamsRouteChecklistPut,ResponseRouteChecklistPut>({location: locationRestChecklistPut,request: {state},params: {id,_wp_http_referer: window.location.href}});} catch (e) {console.log(e);throw e;} finally {this.busyChecklist = false;}})
Type declaration
-
- (id: string, state: boolean): Promise<void>
-
Parameters
-
id: string
-
state: boolean
Returns Promise<void>
Get the slug from the current process (webpack) instead of the PHP plugin output. For some cases you need to use that.