Skip to content

Latest commit

 

History

History
143 lines (80 loc) · 4.06 KB

isnapshotprocessor.md

File metadata and controls

143 lines (80 loc) · 4.06 KB
id title sidebar_label
isnapshotprocessor
ISnapshotProcessor
ISnapshotProcessor

mobx-state-tree - v5.2.0ISnapshotProcessor

A type that has its snapshots processed.

Type parameters

IT: IAnyType

CustomC

CustomS

Hierarchy

  • IType‹_CustomOrOther‹CustomC, IT["CreationType"]›, _CustomOrOther‹CustomS, IT["SnapshotType"]›, IT["TypeWithoutSTN"]›

    ISnapshotProcessor

Index

Properties

Methods

Properties

Optional identifierAttribute

identifierAttribute? : undefined | string

Inherited from IType.identifierAttribute

Defined in packages/mobx-state-tree/src/core/type/type.ts:89

Name of the identifier attribute or null if none.


name

name: string

Inherited from IType.name

Defined in packages/mobx-state-tree/src/core/type/type.ts:84

Friendly type name.

Methods

create

create(snapshot?: C, env?: any): this["Type"]

Inherited from IType.create

Defined in packages/mobx-state-tree/src/core/type/type.ts:96

Creates an instance for the type given an snapshot input.

Parameters:

Name Type
snapshot? C
env? any

Returns: this["Type"]

An instance of that type.


describe

describe(): string

Inherited from IType.describe

Defined in packages/mobx-state-tree/src/core/type/type.ts:118

Gets the textual representation of the type as a string.

Returns: string


is

is(thing: any): thing is _CustomOrOther<CustomC, IT["CreationType"]> | this["Type"]

Inherited from IType.is

Defined in packages/mobx-state-tree/src/core/type/type.ts:104

Checks if a given snapshot / instance is of the given type.

Parameters:

Name Type Description
thing any Snapshot or instance to be checked.

Returns: thing is _CustomOrOther<CustomC, IT["CreationType"]> | this["Type"]

true if the value is of the current type, false otherwise.


validate

validate(thing: _CustomOrOther‹CustomC, IT["CreationType"]›, context: IValidationContext): IValidationResult

Inherited from IType.validate

Defined in packages/mobx-state-tree/src/core/type/type.ts:113

Run's the type's typechecker on the given value with the given validation context.

Parameters:

Name Type Description
thing _CustomOrOther‹CustomC, IT["CreationType"]› Value to be checked, either a snapshot or an instance.
context IValidationContext Validation context, an array of { subpaths, subtypes } that should be validated

Returns: IValidationResult

The validation result, an array with the list of validation errors.