blob: 2c9c9c884cec460160502119ecf98cbba9a02d81 (
about) (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
import { Instance, SnapshotOut, types } from "mobx-state-tree"
/**
* Model description here for TypeScript hints.
*/
export const <%= props.pascalCaseName %>Model = types
.model("<%= props.pascalCaseName %>")
.props({})
.views((self) => ({})) // eslint-disable-line @typescript-eslint/no-unused-vars
.actions((self) => ({})) // eslint-disable-line @typescript-eslint/no-unused-vars
type <%= props.pascalCaseName %>Type = Instance<typeof <%= props.pascalCaseName %>Model>
export interface <%= props.pascalCaseName %> extends <%= props.pascalCaseName %>Type {}
type <%= props.pascalCaseName %>SnapshotType = SnapshotOut<typeof <%= props.pascalCaseName %>Model>
export interface <%= props.pascalCaseName %>Snapshot extends <%= props.pascalCaseName %>SnapshotType {}
export const create<%= props.pascalCaseName %>DefaultModel = () => types.optional(<%= props.pascalCaseName %>Model, {})
|