#

API Docs for: v3.8.1
Show: Inherited Protected Private Deprecated

# IdentityMap Class

Defined in: `addon/-private/system/identity-map.ts:4`
Module: ember-data

`IdentityMap` is a custom storage map for records by modelName used by `DS.Store`.

- Index
- Methods

## Item Index

### Methods

- clear
- diffArray
- retrieve

## Methods

### `clear`

()

Defined in `addon/-private/system/identity-map.ts:33`

Clears the contents of all known `RecordMaps`, but does not remove the InternalModelMap instances.

### `diffArray`

(

- `oldArray`
- `newArray`

)
Hash private

Defined in `addon/-private/system/diff-array.js:1`

#### Parameters:

- `oldArray` Array

  the old array

- `newArray` Array

  the new array

#### Returns:

Hash:

{ firstChangeIndex: , // null if no change addedCount: , // 0 if no change removedCount: // 0 if no change }

### `retrieve`

(

- `modelName`

)
InternalModelMap

Defined in `addon/-private/system/identity-map.ts:14`

Retrieves the `InternalModelMap` for a given modelName, creating one if one did not already exist. This is similar to `getWithDefault` or `get` on a `MapWithDefault`

#### Parameters:

- `modelName` Object

  a previously normalized modelName

#### Returns:

InternalModelMap:

the InternalModelMap for the given modelName