# Map Creator

If you have many similar stores (for instance, in advanced database ORM), you can define map creator (like a “class” in OOP).

```js
const User = mapCreator((store, id) => {
  store.set({ id, isLoading: true })
  fetchUser(id).then(data => {
    store.set({ id, isLoading: false, data })
  })
})

let user1 = User('1')
```

***

*Imported from the [Nano Stores README](https://github.com/nanostores/nanostores/blob/1.5.5/README.md#map-creator) for version 1.5.5. Improve this page there.*
