useCADataverseNotificationCenter
@spartanfx/react / codeapps / useCADataverseNotificationCenter
Function: useCADataverseNotificationCenter()
function useCADataverseNotificationCenter(config): INotificationCenterHook;
Power Apps Code Apps NotificationCenter hook backed by Dataverse.
Consumes a generated <Table>Service from pac code add-data-source -a dataverse.
Parameters
config
IUseCADataverseNotificationCenterConfig
Returns
Example
import { NotificationsService } from './generated/services/NotificationsService';
import { useCADataverseNotificationCenter } from '@spartanfx/react/codeapps';
const hook = useCADataverseNotificationCenter({
service: NotificationsService,
schema: {
id: 'cr1a3_notificationid',
title: 'cr1a3_title',
message: 'cr1a3_message',
level: 'cr1a3_level',
isRead: 'cr1a3_isread',
},
onNotify: (level, msg) => toast[level](msg),
});
return <NotificationCenter provider={hook} />;