> For the complete documentation index, see [llms.txt](https://standard-resource.js.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://standard-resource.js.org/api-reference/createresourcestore.md).

# createResourceStore

Creates a resource store that holds all of the resource data of your app. There should only be a single resource store in your app.

## Arguments

1. `initialState` *(Object)*: The initial state. This can be useful in universal apps or progressive web apps.
2. \[`options`] *(object)*: Optional additional options to configure the store. Presently, the only option is `schemas`, which is where you can define schemas for your resource types.

## Returns

([`Store`](https://github.com/jamesplease/standard-resource/tree/9c3750d59655134b6ca06bfc8b5f99992e6c91d8/docs/api-reference/Store.md)): An object that holds all of the resource data for your app. It provides methods to update resources and resource groups, as well as methods to retrieve them from the store.

## Example

```javascript
import createResourceStore from 'standard-resource';

const store = createResourceStore();

store.update('resources.books.24', {
  attributes: {
    name: 'Lord of the Rings',
  },
});

console.log(store.getResources('books', ['24']));
// [
//   {
//     id: '24',
//     attributes: { name: 'Lord of the Rings' },
//     meta: {},
//     computedAttributes: {}
//   }
// ]
```
