UNPKG

459 BMarkdownView Raw
1## Plugin
2
3Plugin is a function that expects a callback function that takes current Radi scope as first argument. This way we can register plugins easily to the current scope of Radi.
4
5```js
6import plugin from 'radi'
7
8const myCoolPlugin = _radi => {
9 // Your plugins logic here
10 // create _radi.Component, make it headless, sky is the limit
11 // can also return anyhing
12 return {
13 mom: 'hi'
14 }
15}
16
17const { mom } = plugin(myCoolPlugin)
18// mom = 'hi'
19```