docs(api-ref): adding event hub doc

This commit is contained in:
nathan-pichon 2023-02-15 10:09:00 +01:00
parent b45459020f
commit a2e8c9a2f2
No known key found for this signature in database
3 changed files with 34 additions and 6 deletions

View File

@ -100,4 +100,10 @@ Strapi server object.
### `strapi.fs`
- [<Type>StrapiFS</Type>](StrapiFS)
Wrapper around [FS NodeJS module](https://nodejs.org/docs/latest-v18.x/api/fs.html).
Wrapper around [FS NodeJS module](https://nodejs.org/docs/latest-v18.x/api/fs.html).
### `strapi.eventHub`
- [<Type>EventHub</Type>](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.

View File

@ -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

View File

@ -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