summaryrefslogtreecommitdiff
path: root/app/models/character-store
diff options
context:
space:
mode:
authorKirill Rogovoy <[email protected]>2021-07-19 20:06:08 +0300
committerKirill Rogovoy <[email protected]>2021-07-19 20:06:08 +0300
commitf0bf4e7afdcd8b02a62be45ab3e7d047ed865a79 (patch)
tree575c0ff2cbb846252bd2e494c81c396846aab2f6 /app/models/character-store
parent67ad38d0a7cd319623e9f41c0c381ed5c5f6f973 (diff)
Apply Prettier
Diffstat (limited to 'app/models/character-store')
-rw-r--r--app/models/character-store/character-store.test.ts4
-rw-r--r--app/models/character-store/character-store.ts15
2 files changed, 10 insertions, 9 deletions
diff --git a/app/models/character-store/character-store.test.ts b/app/models/character-store/character-store.test.ts
index 6d82079..fc17694 100644
--- a/app/models/character-store/character-store.test.ts
+++ b/app/models/character-store/character-store.test.ts
@@ -1,6 +1,6 @@
-import { CharacterStoreModel } from "./character-store"
+import { CharacterStoreModel } from './character-store'
-test("can be created", () => {
+test('can be created', () => {
const instance = CharacterStoreModel.create({})
expect(instance).toBeTruthy()
diff --git a/app/models/character-store/character-store.ts b/app/models/character-store/character-store.ts
index bd92615..2496fcd 100644
--- a/app/models/character-store/character-store.ts
+++ b/app/models/character-store/character-store.ts
@@ -1,13 +1,13 @@
-import { Instance, SnapshotOut, types } from "mobx-state-tree"
-import { CharacterModel, CharacterSnapshot } from "../character/character"
-import { CharacterApi } from "../../services/api/character-api"
-import { withEnvironment } from "../extensions/with-environment"
+import { Instance, SnapshotOut, types } from 'mobx-state-tree'
+import { CharacterModel, CharacterSnapshot } from '../character/character'
+import { CharacterApi } from '../../services/api/character-api'
+import { withEnvironment } from '../extensions/with-environment'
/**
* Example store containing Rick and Morty characters
*/
export const CharacterStoreModel = types
- .model("CharacterStore")
+ .model('CharacterStore')
.props({
characters: types.optional(types.array(CharacterModel), []),
})
@@ -22,7 +22,7 @@ export const CharacterStoreModel = types
const characterApi = new CharacterApi(self.environment.api)
const result = await characterApi.getCharacters()
- if (result.kind === "ok") {
+ if (result.kind === 'ok') {
self.saveCharacters(result.characters)
} else {
__DEV__ && console.tron.log(result.kind)
@@ -34,4 +34,5 @@ type CharacterStoreType = Instance<typeof CharacterStoreModel>
export interface CharacterStore extends CharacterStoreType {}
type CharacterStoreSnapshotType = SnapshotOut<typeof CharacterStoreModel>
export interface CharacterStoreSnapshot extends CharacterStoreSnapshotType {}
-export const createCharacterStoreDefaultModel = () => types.optional(CharacterStoreModel, {})
+export const createCharacterStoreDefaultModel = () =>
+ types.optional(CharacterStoreModel, {})