docs: add big warning about plugins
This commit is contained in:
@@ -408,9 +408,15 @@ document.body.appendChild(tree)
|
|||||||
|
|
||||||
Generally people using `choo` shouldn't be too worried about the specifics of
|
Generally people using `choo` shouldn't be too worried about the specifics of
|
||||||
`plugins`, as the internal API is (unfortunatly by necessecity) quite complex.
|
`plugins`, as the internal API is (unfortunatly by necessecity) quite complex.
|
||||||
After all they're the most powerful way to modify a `choo` appliction. If you
|
After all they're the most powerful way to modify a `choo` appliction.
|
||||||
want to learn more about creating your own `plugins`, and which `hooks` are
|
|
||||||
available, head on over to [app.use()](#appusehooks).
|
__:warning: Warning :warning:: plugins should only be used as a last resort.
|
||||||
|
It creates peer dependencies which makes upgrading versions and switching
|
||||||
|
frameworks a lot harder. Please exhaust all other options before using
|
||||||
|
plugins.__
|
||||||
|
|
||||||
|
If you want to learn more about creating your own `plugins`, and which `hooks`
|
||||||
|
are available, head on over to [app.use()](#appusehooks).
|
||||||
|
|
||||||
## Badges
|
## Badges
|
||||||
Using `choo` in a project? Show off which version you've used using a badge:
|
Using `choo` in a project? Show off which version you've used using a badge:
|
||||||
@@ -485,6 +491,11 @@ There are several `hooks` that are picked up by `choo`:
|
|||||||
- __onStateChange(action, state, prev, caller, createSend):__ called after a
|
- __onStateChange(action, state, prev, caller, createSend):__ called after a
|
||||||
reducer changes the `state`.
|
reducer changes the `state`.
|
||||||
|
|
||||||
|
__:warning: Warning :warning:: plugins should only be used as a last resort.
|
||||||
|
It creates peer dependencies which makes upgrading versions and switching
|
||||||
|
frameworks a lot harder. Please exhaust all other options before using
|
||||||
|
plugins.__
|
||||||
|
|
||||||
`createSend()` is a special function that allows the creation of a new named
|
`createSend()` is a special function that allows the creation of a new named
|
||||||
`send()` function. The first argument should be a string which is the name, the
|
`send()` function. The first argument should be a string which is the name, the
|
||||||
second argument is a boolean `callOnError` which can be set to `true` to call
|
second argument is a boolean `callOnError` which can be set to `true` to call
|
||||||
|
|||||||
Reference in New Issue
Block a user