Update quickstart plugin skeleton
This commit is contained in:
28
.github/quickstart/plugin/index.mjs
vendored
28
.github/quickstart/plugin/index.mjs
vendored
@@ -1,15 +1,15 @@
|
|||||||
//Setup
|
//Setup
|
||||||
export default async function({login, q, imports, data, computed, rest, graphql, queries, account}, {enabled = false} = {}) {
|
export default async function({login, q, imports, data, computed, rest, graphql, queries, account}, {enabled = false} = {}) {
|
||||||
//Plugin execution
|
//Plugin execution
|
||||||
try {
|
try {
|
||||||
//Check if plugin is enabled and requirements are met
|
//Check if plugin is enabled and requirements are met
|
||||||
if ((!enabled)||(!q.<%= name %>))
|
if ((!enabled)||(!q.<%= name %>))
|
||||||
return null
|
return null
|
||||||
//Results
|
//Results
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
//Handle errors
|
//Handle errors
|
||||||
catch (error) {
|
catch (error) {
|
||||||
throw {error:{message:"An error occured", instance:error}}
|
throw {error:{message:"An error occured", instance:error}}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user