From 3239a8c18a481ee0f93578eff1448706dd54c942 Mon Sep 17 00:00:00 2001 From: Luna Date: Wed, 20 Mar 2019 00:37:30 -0300 Subject: [PATCH] docs/pubsub.md: add practical call --- docs/pubsub.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/pubsub.md b/docs/pubsub.md index b8effc8..66dc0fe 100644 --- a/docs/pubsub.md +++ b/docs/pubsub.md @@ -55,3 +55,12 @@ The other available superclass is `DispatchWithState` for backends that require a list of subscribers to not repeat code. The only required method to be implemented is `dispatch()` and you can see how that works out on the backends that inherit from this class. + +## Sending an event, practical + +Call `app.dispatcher.dispatch(backend_string, key, event_type, event_payload)`. + +example: + - `dispatch('guild', guild_id, 'GUILD_UPDATE', guild)`, and other backends. + The rules on how each backend dispatches its events can be found on the + specific backend class.