home
  • Blog
  • Home
  • Projects
    • Ember
    • EmberData
    • Ember CLI
4.12
  • Packages
    • @ember-data/adapter
    • @ember-data/adapter/error
    • @ember-data/adapter/json-api
    • @ember-data/adapter/rest
    • @ember-data/canary-features
    • @ember-data/debug
    • @ember-data/deprecations
    • @ember-data/experimental-preview-types
    • @ember-data/graph
    • @ember-data/json-api
    • @ember-data/legacy-compat
    • @ember-data/model
    • @ember-data/request
    • @ember-data/request/fetch
    • @ember-data/serializer
    • @ember-data/serializer/json
    • @ember-data/serializer/json-api
    • @ember-data/serializer/rest
    • @ember-data/store
    • @ember-data/tracking
  • Classes
    • <Interface> Adapter
    • <Interface> Cache
    • <Interface> Handler
    • <Interface> Serializer
    • AbortError
    • Adapter
    • AdapterError
    • BelongsToReference
    • BooleanTransform
    • BuildURLMixin
    • Cache
    • CacheManager
    • CacheStoreWrapper
    • CanaryFeatureFlags
    • ConflictError
    • CurrentDeprecations
    • DateTransform
    • DebugLogging
    • EmbeddedRecordsMixin
    • Errors
    • Fetch
    • ForbiddenError
    • Future
    • HasManyReference
    • IdentifierCache
    • InvalidError
    • JSONAPIAdapter
    • JSONAPISerializer
    • JSONSerializer
    • ManyArray
    • Model
    • NotFoundError
    • NotificationManager
    • NumberTransform
    • PromiseArray
    • PromiseManyArray
    • PromiseObject
    • RESTAdapter
    • RESTSerializer
    • RecordArray
    • RecordReference
    • RequestManager
    • RequestStateService
    • SchemaService
    • Serializer
    • ServerError
    • Snapshot
    • SnapshotRecordArray
    • StableRecordIdentifier
    • Store
    • StringTransform
    • TimeoutError
    • Transform
    • UnauthorizedError

Class NotificationManager public


Defined in: ../store/src/-private/managers/notification-manager.ts:70
Module: @ember-data/store

The NotificationManager provides the ability to subscribe to changes to Cache state.

This Feature is what allows EmberData to create subscriptions that work with any framework or change-notification system.


Methods

subscribe (identifier, callback) : UnsubscribeToken public

Module: @ember-data/store

Defined in ../packages/store/src/-private/managers/notification-manager.ts:101

identifier
StableDocumentIdentifier | StableRecordIdentifier | 'resource' | 'document'
callback
NotificationCallback | ResourceOperationCallback | DocumentOperationCallback
returns
UnsubscribeToken

an opaque token to be used with unsubscribe

Subscribe to changes for a given resource identifier, resource addition/removal, or document addition/removal.

export type CacheOperation = 'added' | 'removed' | 'updated' | 'state';

export interface NotificationCallback {
  (identifier: StableRecordIdentifier, notificationType: 'attributes' | 'relationships', key?: string): void;
  (identifier: StableRecordIdentifier, notificationType: 'errors' | 'meta' | 'identity' | 'state'): void;
  (identifier: StableRecordIdentifier, notificationType: NotificationType, key?: string): void;
}
export interface ResourceOperationCallback {
  // resource updates
  (identifier: StableRecordIdentifier, notificationType: CacheOperation): void;
}
export interface DocumentOperationCallback {
  // document updates
  (identifier: StableDocumentIdentifier, notificationType: CacheOperation): void;
}

unsubscribe (token) public

Module: @ember-data/store

Defined in ../packages/store/src/-private/managers/notification-manager.ts:156

token
UnsubscribeToken

remove a previous subscription

On this page


Methods

  • subscribe
  • unsubscribe
Team Sponsors Security Legal Branding Community Guidelines
Twitter GitHub Discord Mastodon

If you want help you can contact us by email, open an issue, or get realtime help by joining the Ember Discord.

© Copyright 2025 - Tilde Inc.
Ember.js is free, open source and always will be.


Ember is generously supported by
blue Created with Sketch.