1 | ## Plugin
|
2 |
|
3 | Plugin 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
|
6 | import plugin from 'radi'
|
7 |
|
8 | const 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 |
|
17 | const { mom } = plugin(myCoolPlugin)
|
18 | // mom = 'hi'
|
19 | ```
|