From 759979f9957f472d097822aafa723dcf4b0cf889 Mon Sep 17 00:00:00 2001 From: Ian Storm Taylor Date: Fri, 27 Oct 2017 13:11:30 -0700 Subject: [PATCH] add extra code sample to plugins guide --- docs/guides/plugins.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/guides/plugins.md b/docs/guides/plugins.md index 0868e2ad2..bd5bbe29e 100644 --- a/docs/guides/plugins.md +++ b/docs/guides/plugins.md @@ -196,7 +196,24 @@ function Bold(options) { } ``` -With things like `changes` and `helpers`, you can define your bold logic in a single place, and allow other parts of your codebase to use the exposed API to keep consistent. +With things like `changes` and `helpers`, you can define your bold logic in a single place, and allow other parts of your codebase to use the exposed API to keep consistent. Then you can use them like so: + +```js +const bold = Bold() +const italic = Italic() +... + +const plugins = [ + ...bold.plugins, + ...italic.plugins, + ... +] + + +``` Feature plugins like that are almost always made up of many smaller helper plugins. And they are usually app-specific, so they don't make great open-source candidates.