Robert Perillo
Robert Perillo

Reputation: 41

SharePoint Framework (SPFx): Publisher/Subscriber general concept question

I am very new to using SPFx and have a general question about using its Pub/Sub model via sp-dynamic-data with DynamicDataSourceManager.

I have been using React and react Contexts/Providers quite a bit in the past and was wondering:

  1. What are the main differences between using the native SPFx dynamic data tools VS. React contexts/providers.
  2. Any advantages or disadvantages to using either aside from preference.

Thank you in advance!

Upvotes: 0

Views: 175

Answers (1)

Nikolay
Nikolay

Reputation: 12245

As far as I know, the pub/sub for SPFx assumes communication between different web parts (applications). For example, if you have a List View on the page, and want to react to events from it, you could subscribe to its events (for example, user selected an item). Means, it is intended for interaction between different web parts / applications (from different manufacturers, maybe) that live on the same page.

In React, you are usually working within the boundaries of your own application. But, in principle, the idea is similar to context/provider - one entity publishes an event and another subscribes to it.

Upvotes: 1

Related Questions