sp-dev-fx-webparts/samples/react-events-aggregator
Joel Rodrigues 764d8f10e0 Add tslint at the root of each SPFx project (#394) 2018-01-08 15:58:48 +02:00
..
assets Two samples on communication between web parts through broadcasting events utilizing the Publish–subscribe pattern (#290) 2017-09-05 12:05:47 +03:00
config Two samples on communication between web parts through broadcasting events utilizing the Publish–subscribe pattern (#290) 2017-09-05 12:05:47 +03:00
src Two samples on communication between web parts through broadcasting events utilizing the Publish–subscribe pattern (#290) 2017-09-05 12:05:47 +03:00
.editorconfig Two samples on communication between web parts through broadcasting events utilizing the Publish–subscribe pattern (#290) 2017-09-05 12:05:47 +03:00
.gitattributes Two samples on communication between web parts through broadcasting events utilizing the Publish–subscribe pattern (#290) 2017-09-05 12:05:47 +03:00
.gitignore Two samples on communication between web parts through broadcasting events utilizing the Publish–subscribe pattern (#290) 2017-09-05 12:05:47 +03:00
.npmignore Two samples on communication between web parts through broadcasting events utilizing the Publish–subscribe pattern (#290) 2017-09-05 12:05:47 +03:00
.yo-rc.json Two samples on communication between web parts through broadcasting events utilizing the Publish–subscribe pattern (#290) 2017-09-05 12:05:47 +03:00
README.md Updated readme with clear support statement in production usage. 2017-09-05 12:10:37 +03:00
gulpfile.js Two samples on communication between web parts through broadcasting events utilizing the Publish–subscribe pattern (#290) 2017-09-05 12:05:47 +03:00
package.json Two samples on communication between web parts through broadcasting events utilizing the Publish–subscribe pattern (#290) 2017-09-05 12:05:47 +03:00
tsconfig.json Two samples on communication between web parts through broadcasting events utilizing the Publish–subscribe pattern (#290) 2017-09-05 12:05:47 +03:00
tslint.json Add tslint at the root of each SPFx project (#394) 2018-01-08 15:58:48 +02:00

README.md

SPFx Event Aggregator Sample

Summary

This sample shows how we can use the SPFx Event Aggregator to communicate between web parts through broadcasting events utilizing the Publishsubscribe pattern. It enables a webpart or component to raise event (broadcast message) through the SPFx event aggregator and that event is received by other web parts or components that have been subscribed to receive it.

Please note the SPFx Event Aggregator is still in Alpha and NOT SUPPORTED IN PRODUCTION USE, but this sample will be updated in future when there are changes from the Alpha version to GA.

SPFx eventAggregator

Used SharePoint Framework Version

drop

Applies to

Prerequisites

Solution

Solution Author(s)
react-events-aggregator Miguel Rabaca ( Spanish Point ), Velin Georgiev ( @VelinGeorgiev ), Austin Breslin ( @AustinBreslin )

Version history

Version Date Comments
0.0.1 August 22, 2017 Initial commit

Disclaimer

THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.


Minimal Path to Awesome

  • Clone this repository.
  • Open the command line, navigate to the web part folder and execute:
    • npm i
    • gulp test (optional)
    • gulp serve

Features

This Web Part illustrates the following concepts on top of the SharePoint Framework:

  • Using React for building SharePoint Framework client-side web parts.
  • Using Office UI Fabric React styles for building user experience consistent with SharePoint and Office.
  • The use the SPFx event aggregator to broadcast messages (events).
  • The use the SPFx event aggregator to subscribe and receive broadcasted messages (events).
  • Unit tests including spies, mocks and faking class methods and properties.