Documentation / @warp-drive/core / store / NotificationManager
Interface: NotificationManager
Defined in: core/src/store/-private/managers/notification-manager.ts:93
Hideconstructor
The NotificationManager provides the ability to subscribe to changes to Cache state.
This Feature is what allows WarpDrive to create subscriptions that work with any framework or change-notification system.
Methods
subscribe()
Call Signature
subscribe(cacheKey, callback): object;
Defined in: core/src/store/-private/managers/notification-manager.ts:143
Subscribe to changes for a given ResourceKey, RequestKey, or addition/removal of any resource or document.
export type CacheOperation = 'added' | 'removed' | 'updated' | 'state';
export interface NotificationCallback {
(cacheKey: ResourceKey, notificationType: 'attributes' | 'relationships', key?: string): void;
(cacheKey: ResourceKey, notificationType: 'errors' | 'meta' | 'identity' | 'state'): void;
(cacheKey: ResourceKey, notificationType: NotificationType, key?: string): void;
}
export interface ResourceOperationCallback {
// resource updates
(cacheKey: ResourceKey, notificationType: CacheOperation): void;
}
export interface DocumentOperationCallback {
// document updates
(cacheKey: RequestKey, notificationType: CacheOperation): void;
}
Parameters
cacheKey
callback
NotificationCallback
Returns
object
an opaque token to be used with unsubscribe
Call Signature
subscribe(cacheKey, callback): object;
Defined in: core/src/store/-private/managers/notification-manager.ts:144
Subscribe to changes for a given ResourceKey, RequestKey, or addition/removal of any resource or document.
export type CacheOperation = 'added' | 'removed' | 'updated' | 'state';
export interface NotificationCallback {
(cacheKey: ResourceKey, notificationType: 'attributes' | 'relationships', key?: string): void;
(cacheKey: ResourceKey, notificationType: 'errors' | 'meta' | 'identity' | 'state'): void;
(cacheKey: ResourceKey, notificationType: NotificationType, key?: string): void;
}
export interface ResourceOperationCallback {
// resource updates
(cacheKey: ResourceKey, notificationType: CacheOperation): void;
}
export interface DocumentOperationCallback {
// document updates
(cacheKey: RequestKey, notificationType: CacheOperation): void;
}
Parameters
cacheKey
"resource"
callback
ResourceOperationCallback
Returns
object
an opaque token to be used with unsubscribe
Call Signature
subscribe(cacheKey, callback): object;
Defined in: core/src/store/-private/managers/notification-manager.ts:145
Subscribe to changes for a given ResourceKey, RequestKey, or addition/removal of any resource or document.
export type CacheOperation = 'added' | 'removed' | 'updated' | 'state';
export interface NotificationCallback {
(cacheKey: ResourceKey, notificationType: 'attributes' | 'relationships', key?: string): void;
(cacheKey: ResourceKey, notificationType: 'errors' | 'meta' | 'identity' | 'state'): void;
(cacheKey: ResourceKey, notificationType: NotificationType, key?: string): void;
}
export interface ResourceOperationCallback {
// resource updates
(cacheKey: ResourceKey, notificationType: CacheOperation): void;
}
export interface DocumentOperationCallback {
// document updates
(cacheKey: RequestKey, notificationType: CacheOperation): void;
}
Parameters
cacheKey
"document"
| RequestKey
callback
DocumentOperationCallback
Returns
object
an opaque token to be used with unsubscribe
unsubscribe()
unsubscribe(token): void;
Defined in: core/src/store/-private/managers/notification-manager.ts:176
remove a previous subscription
Parameters
token
object
Returns
void