From a2e8c9a2f24fc32c423c683a33d3b98d461efe93 Mon Sep 17 00:00:00 2001 From: nathan-pichon Date: Wed, 15 Feb 2023 10:09:00 +0100 Subject: [PATCH] docs(api-ref): adding event hub doc --- docs/docs/api/Strapi.mdx | 8 +++++++- docs/docs/api/event-hub.mdx | 27 +++++++++++++++++++++++++++ packages/core/strapi/lib/Strapi.js | 5 ----- 3 files changed, 34 insertions(+), 6 deletions(-) create mode 100644 docs/docs/api/event-hub.mdx diff --git a/docs/docs/api/Strapi.mdx b/docs/docs/api/Strapi.mdx index e734bd161f..b26fc98659 100644 --- a/docs/docs/api/Strapi.mdx +++ b/docs/docs/api/Strapi.mdx @@ -100,4 +100,10 @@ Strapi server object. ### `strapi.fs` - [StrapiFS](StrapiFS) -Wrapper around [FS NodeJS module](https://nodejs.org/docs/latest-v18.x/api/fs.html). \ No newline at end of file +Wrapper around [FS NodeJS module](https://nodejs.org/docs/latest-v18.x/api/fs.html). + +### `strapi.eventHub` +- [EventHub](EventHub) + +Module to manipulate events around Strapi project. It is an instance of [EventEmitter](https://nodejs.org/docs/latest-v18.x/api/events.html#class-eventemitter) from NodeJS. + diff --git a/docs/docs/api/event-hub.mdx b/docs/docs/api/event-hub.mdx new file mode 100644 index 0000000000..1e21fe5de4 --- /dev/null +++ b/docs/docs/api/event-hub.mdx @@ -0,0 +1,27 @@ +--- +title: EventHub +slug: /api/EventHub +tags: +- module +- public + +toc_min_heading_level: 2 +toc_max_heading_level: 3 +--- +import Type from '@site/docs/api/components/Type'; + +# Strapi Event Hub + +:::info + +Current state: **Stable** + +::: + +Strapi Event Hub module - description to be done + +## Module: EventHub + +### `createEventHub()` + +//TODO \ No newline at end of file diff --git a/packages/core/strapi/lib/Strapi.js b/packages/core/strapi/lib/Strapi.js index 8af7ebf16d..86838dc293 100644 --- a/packages/core/strapi/lib/Strapi.js +++ b/packages/core/strapi/lib/Strapi.js @@ -112,11 +112,6 @@ class Strapi { // Strapi utils instanciation this.fs = createStrapiFs(this); - // TODO put this in /docs/docs/API/Strapi - /* - eventHub instance of EventEmitter = require('events'); - Link to nodejs events doc - */ this.eventHub = createEventHub(); // TODO put this in /docs/docs/API/Strapi