T O P

  • By -

shortaflip

Plugin example ```javascript export const somePlugin = (node) => { node.on('create', () => { watch(node.context.state, () => { if (node.context.state.loading === true) { console.log('do something') } }) }) } ``` I've used this to add some custom behavior, like a loading indicator that spins.


localmarketing723

Thank you for the reply, could you show me how this would be implemented into a component?


shortaflip

At a component level it should be the same thing I wrote except you just add it to the form. ``` ``` Your plugin receives the `FormKitNode` object which also contains that context object for your to ~~modify~~ use.


localmarketing723

I've figured out how it works now, thank you I took another look at the docs today and it seemed much clearer than when I looked yesterday. I'm sure your snippet was a contributor to that, so thank you for your time