Event aggregator sample deprecated (#690)
* Deprecation message added to the README * Deprecation message added to the web parts as well
This commit is contained in:
parent
5e384a06d7
commit
9363bfa698
|
@ -1,5 +1,9 @@
|
||||||
# SPFx Event Aggregator Sample #
|
# SPFx Event Aggregator Sample #
|
||||||
|
|
||||||
|
# Important: The event aggregator is deprecated and no longer available in the SharePoint Framework. Please use [dynamic data](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/dynamic-data) instead. #
|
||||||
|
|
||||||
|
Following issue [#659](https://github.com/SharePoint/sp-dev-fx-webparts/issues/659), the event aggregator functionality is no longer working. This feature was in ALPHA state and never made it to general availability state. There is a replacement for the event aggregator. Please have a look at the dynamic data functionality and use it instead [https://docs.microsoft.com/en-us/sharepoint/dev/spfx/dynamic-data](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/dynamic-data). There is already a sample in this library [https://github.com/SharePoint/sp-dev-fx-webparts/tree/master/samples/react-events-dynamicdata](https://github.com/SharePoint/sp-dev-fx-webparts/tree/master/samples/react-events-dynamicdata)
|
||||||
|
|
||||||
## Summary
|
## Summary
|
||||||
|
|
||||||
This sample shows how we can use the SPFx Event Aggregator to communicate between web parts through broadcasting events utilizing the [Publish–subscribe pattern](https://en.wikipedia.org/wiki/Publish–subscribe_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.
|
This sample shows how we can use the SPFx Event Aggregator to communicate between web parts through broadcasting events utilizing the [Publish–subscribe pattern](https://en.wikipedia.org/wiki/Publish–subscribe_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.
|
||||||
|
@ -34,6 +38,7 @@ Version|Date|Comments
|
||||||
-------|----|--------
|
-------|----|--------
|
||||||
0.0.1|August 22, 2017 | Initial commit
|
0.0.1|August 22, 2017 | Initial commit
|
||||||
0.0.2|March 20, 2018 | Updated to SPFx v1.4.1
|
0.0.2|March 20, 2018 | Updated to SPFx v1.4.1
|
||||||
|
0.0.3|November 18, 2018 | Sample deprecated
|
||||||
|
|
||||||
## Disclaimer
|
## 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.**
|
**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.**
|
||||||
|
|
|
@ -23,6 +23,7 @@ export default class Broadcaster extends React.Component<IBroadcasterProps, IBro
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
<div className={`ms-Grid-row ms-bgColor-themeDark ms-fontColor-white ${styles.row}`}>
|
<div className={`ms-Grid-row ms-bgColor-themeDark ms-fontColor-white ${styles.row}`}>
|
||||||
<div className="ms-Grid-col ms-u-lg10 ms-u-xl8 ms-u-xlPush2 ms-u-lgPush1">
|
<div className="ms-Grid-col ms-u-lg10 ms-u-xl8 ms-u-xlPush2 ms-u-lgPush1">
|
||||||
|
<h1>Important: The event aggregator is deprecated and no longer available in the SharePoint Framework. Please use dynamic data https://docs.microsoft.com/en-us/sharepoint/dev/spfx/dynamic-data instead. See the README.md file for more details.</h1>
|
||||||
<h2>Event Message: {this.state.eventNumber}</h2>
|
<h2>Event Message: {this.state.eventNumber}</h2>
|
||||||
<PrimaryButton onClick={this.broadcastData.bind(this)} id="BroadcastButton">
|
<PrimaryButton onClick={this.broadcastData.bind(this)} id="BroadcastButton">
|
||||||
Broadcast message
|
Broadcast message
|
||||||
|
|
|
@ -26,6 +26,7 @@ export default class Receiver extends React.Component<IReceiverProps, IReceiverS
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
<div className={`ms-Grid-row ms-bgColor-themeDark ms-fontColor-white ${styles.row}`}>
|
<div className={`ms-Grid-row ms-bgColor-themeDark ms-fontColor-white ${styles.row}`}>
|
||||||
<div className="ms-Grid-col ms-u-lg10 ms-u-xl8 ms-u-xlPush2 ms-u-lgPush1">
|
<div className="ms-Grid-col ms-u-lg10 ms-u-xl8 ms-u-xlPush2 ms-u-lgPush1">
|
||||||
|
<h1>Important: The event aggregator is deprecated and no longer available in the SharePoint Framework. Please use dynamic data https://docs.microsoft.com/en-us/sharepoint/dev/spfx/dynamic-data instead. See the README.md file for more details.</h1>
|
||||||
<h2>Received events:</h2>
|
<h2>Received events:</h2>
|
||||||
{
|
{
|
||||||
this.state.eventsList.map((item: { index: number, data: number }) => {
|
this.state.eventsList.map((item: { index: number, data: number }) => {
|
||||||
|
|
Loading…
Reference in New Issue