Spectral 4.x Upgrade Guide
Spectral 4.x introduces the ability to write component-specific triggers. This version is purely additive, so very few changes to your code need to occur.
To start, update @prismatic-io/spectral
to ^4.0.6
in your package.json
file and then run npm install
or yarn install
:
{
"dependencies": {
"@prismatic-io/spectral": "^4.0.6"
}
}
Next, optionally write some triggers and add those triggers to your component
definition:
export default component({
key: "sampleComponent",
public: false,
display: {
label: "Sample Component",
description: "sampleComponent",
iconPath: "icon.png",
},
actions: { myAction1, myAction2, myAction3 },
triggers: { myTrigger1, myTrigger2 },
});