From 48572b94539e8f657c902c6153ac50678108ee2b Mon Sep 17 00:00:00 2001 From: Patrizio Bekerle <patrizio@bekerle.com> Date: Thu, 11 Mar 2021 08:31:45 +0100 Subject: [PATCH] Add more structure --- packages/provider/README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/provider/README.md b/packages/provider/README.md index 5b8f8834..5fdc9312 100644 --- a/packages/provider/README.md +++ b/packages/provider/README.md @@ -45,7 +45,7 @@ All other components are also inherent providers (see below), so you don't reall of other components. The use of `dbp-provider` is mainly suggested being used for namespacing (e.g. different languages or entry point urls on the same page) or to deliver attribute changes across different components. -### Flow +### Examples #### Example 1 - Simple communication @@ -73,6 +73,8 @@ sequenceDiagram P->>PS: "lang" was updated to "en" ``` +##### Flow + 1) The language selector propagates a change of `lang` (because the user clicked on it) 2) The provider receives that event, because it has the attribute `lang` set 3) The provider executes a callback with the updated value for `lang` in all components that subscribed `lang` @@ -113,6 +115,8 @@ sequenceDiagram P1->>PS: "auth" was updated to "{...json...}" ``` +##### Flow + 1) The language selector propagates a change of `lang` (because the user clicked on it) 2) The provider 2 receives that event, because it has the attribute `lang` set 3) The provider 2 executes a callback with the updated value for `lang` in all components that subscribed `lang` -- GitLab