<!DOCTYPE html>
<html>

  <head>
    <script src="https://cdn.rawgit.com/js-data/js-data/master/dist/js-data.js"></script>
    <script src="script.js"></script>
  </head>

  <body>
    <h1>Open up your console to see the output</h1>
  </body>

</html>
var store = new JSData.DS();

var User = store.defineResource('user');

console.log('User.get(1)', User.get(1));

console.log('User.inject({ id: 1 }', User.inject({
  id: 1
}));

console.log('User.get(1)', User.get(1));

console.log('User.eject(1)', User.eject(1));

  console.log('User.get(1)', User.get(1));
## DS#eject(resourceName, id[, options])

Eject the item of the specified type that has the given primary key from the data store. Ejection only removes items from the data store and does not attempt to destroy items via an adapter.

Returns the ejected item if it was ejected.

###### Arguments

| name | type | description |
| ---- | ---- | ----------- |
| resourceName | string | The name of the resource to use. Unnecessary if using the resource directly. |
| id | string or number | The primary key of the item to eject. |
| options | object | Configuration options. |
| options.notify | boolean | Whether to call the `beforeEject` and `afterEject` hooks and emit the `DS.eject` event. Default: `true`. |

###### Examples

```js
User.get(1); // { id: 1, name: 'John' }

// See Method Variants section below for different ways to call DS#eject
User.eject(1); // { id: 1, name: 'John' }

User.get(1); // undefined
```