Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mobx-state-tree

Package Overview
Dependencies
Maintainers
2
Versions
129
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mobx-state-tree - npm Package Versions

1
1113

0.7.1

Diff

Changelog

Source

0.7.1

  • Fixed array.remove not working
mweststrate
published 0.7.0 •

Changelog

Source

0.7.0

The type system and internal administration has been refactoring, making the internals both simpler and more flexible. Things like references and identifiers are now first class types, making them much better composable. #152

  • BREAKING References with a predefined lookup path are no longer supported. Instead of that, identifiers are now looked up in the entire tree. For that reasons identifiers now have to be unique in the entire tree, per type.
  • BREAKING resolve is renamed to resolvePath
  • Introduced resolveIdentifier(type, tree, identifier) to find objects by identifier
  • BREAKING types.reference is by default non-nullable. For nullable identifiers, use types.maybe(types.reference(X))
  • Many, many improvements. Related open issues will be updated.
  • BREAKING isMST is renamed to isStateTreeNode
mattiamanzati
published 0.6.3 •

Changelog

Source

0.6.3

  • Fixed issue with array/maps of union types @abruzzihraig #151
  • Make types.extend support computed attributes @cpunion #169
  • Fixed issue with map of primitive types and applySnapshot @pioh #155
  • Better type declarations for union, up to 10 supported types
mweststrate
published 0.6.2 •

Changelog

Source

0.6.2

  • Fixed issue where arrays where not properly serialized as action argument
mweststrate
published 0.6.1 •

Changelog

Source

0.6.1

  • Improved reporting of Type.is(), now it returns a fine grained report of why the provided value is not applicable.
[mobx-state-tree] Error while converting [{}] to AnonymousModel[]:
at path "/name" snapshot undefined is not assignable to type: string.
at path "/quantity" snapshot undefined is not assignable to type: number.
  • Fixed support for types.reference in combination with types.late, by @robinfehr
mweststrate
published 0.6.0 •

Changelog

Source

0.6.0

  • BREAKING types.withDefault has been renamed to types.optional
  • BREAKING Array and map types can no longer be left out of snapshots by default. Use optional to make them optional in the snapshot
  • BREAKING Literals no longer have a default value by default (use optional + literal instead)
  • BREAKING Disabled inlining type.model definitions as introduced in 0.5.1; to many subtle issues
  • Improved identifier support, they are no properly propagated through utility types like maybe, union etc
  • Fixed issue where fields where not referred back to default when a partial snapshot was provided
  • Fixed #122: types.identifier now also accepts a subtype to override the default string type; e.g. types.identifier(types.number)
mweststrate
published 0.5.1 •

Changelog

Source

0.5.1

  • Introduced support for lazy evaluating values in withDefault, useful to generate UUID's, timestamps or non-primitive default values
  • ~~It is now possible to define something like~~ Removed in 0.6.0
const Box = types.model({
    point: {
        x: 10,
        y: 10
    }
}

Where the type of point property is inferred to point: types.withDefault(types.model({ x: 10, y: 10}), () => ({ x: 10, y: 10 }))

mweststrate
published 0.5.0 •

Changelog

Source

0.5.0

  • ** BREAKING ** protection is now enabled by default (#101)
  • ** BREAKING ** it is no longer possible to read values from a dead object. Except through getSnapshot or clone (#102)
  • ** BREAKING ** types.recursive has been removed in favor of types.late
  • Introduced unprotect, to disable protection mode for a certain instance. Useful in afterCreate hooks
  • Introduced types.late. Usage: types.late(() => typeDefinition). Can be used for circular / recursive type definitions, even across files. See test/circular(1|2).ts for an example (#74)
mweststrate
published 0.4.0 •

Changelog

Source

0.4.0

BREAKING types.model no requires 2 parameters to define a model. The first parameter defines the properties, derived values and view functions. The second argument is used to define the actions. For example:

const Todo = types.model("Todo", {
    done: types.boolean,
    toggle() {
        this.done = !this.done
    }
})

Now should be defined as:

const Todo = types.model(
    "Todo",
    {
        done: types.boolean
    },
    {
        toggle() {
            this.done = !this.done
        }
    }
)

It is still possible to define functions on the first object. However, those functions are not considered to be actions, but views. They are not allowed to modify values, but instead should produce a new value themselves.

mweststrate
published 0.3.3 •

Changelog

Source

0.3.3

  • Introduced lifecycle hooks afterCreate, afterAttach, beforeDetach, beforeDestroy, implements #76
  • Introduced the convenience method addDisposer(this, cb) that can be used to easily destruct reactions etc. which are set up in afterCreate. See #76
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc