Share formats

Let's use the skill of the previous chapter. We add a format

import code from './my-skill.converse'

export default {
    code,
    formats: {
        smiley(text) {
            return text + ' :)'
        }
    }
}

How to use this format in the parent scenario? We use the shareFormats property:

import code from './my-skill.converse'

export default {
    code,
    formats: {
        smiley(text) {
            return text + ' :)'
        }
    },
    shareFormats: true
}

In the parent ConverseScript, we can then use it:

main.converse

@Event('start')
start() {
    @Format('smiley')
    > Hey
}

Last updated