summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-core/src/createPlugin.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-09-05 11:04:36 +0200
committerSamy Pessé <samypesse@gmail.com>2016-09-05 11:04:36 +0200
commitb170b4d197822f3949b63df69e063d07cbb8e5c9 (patch)
tree556d9919e09eb12bea462a3d3a7801a1cea0611e /packages/gitbook-core/src/createPlugin.js
parenta14ca3e268e95a7eab59fb205b41da7331d57631 (diff)
downloadgitbook-b170b4d197822f3949b63df69e063d07cbb8e5c9.zip
gitbook-b170b4d197822f3949b63df69e063d07cbb8e5c9.tar.gz
gitbook-b170b4d197822f3949b63df69e063d07cbb8e5c9.tar.bz2
Start basis of gitbook-core
Diffstat (limited to 'packages/gitbook-core/src/createPlugin.js')
-rw-r--r--packages/gitbook-core/src/createPlugin.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/packages/gitbook-core/src/createPlugin.js b/packages/gitbook-core/src/createPlugin.js
new file mode 100644
index 0000000..1fcf495
--- /dev/null
+++ b/packages/gitbook-core/src/createPlugin.js
@@ -0,0 +1,16 @@
+
+/**
+ * Create a plugin to extend the state and the views.
+ *
+ * @param {Function(dispatch, state)} onInitialState
+ * @param {Funciton(state, action)} onReduceState
+ * @return {Plugin}
+ */
+function createPlugin(onInitialState, onReduceState) {
+ return {
+ onInitialState,
+ onReduceState
+ };
+}
+
+module.exports = createPlugin;