Skip to content

Releases: vigetlabs/microcosm

v12.7.0-alpha.4: Version 12.7.0-alpha.4

14 Apr 20:26
Compare
Choose a tag to compare
Pre-release
  • Added batch as an option when instantiating Microcosm. When set to
    true, high frequency change events will be batched together using
    requestIdleCallback

v12.7.0-alpha.3: Version 12.7.0-alpha.3

14 Apr 19:13
Compare
Choose a tag to compare
Pre-release
  • Action status changing methods are auto-bound, and will warn when a
    completed action attempts to move into a new state (strict mode only)

Version 12.7.0 Alpha 2

14 Apr 15:55
Compare
Choose a tag to compare
Pre-release
  • The first argument of repo.push is passed into the open state of actions that return promises.

Version 12.6.1

14 Apr 15:55
Compare
Choose a tag to compare
  • Corrected generator check to be resistant to minification

Version 12.5.0

05 Apr 19:27
Compare
Choose a tag to compare
  • Added a defaults static to Microcosm that passes default options to the constructor and setup method.
  • The first argument of setup, the options object passed when instantiating a Microcosm argument, will always be an object. There is no need to handle the null case for options.
  • Added a strict mode build of Microcosm that ships with development assertions. See installation.md for more details

Defaults

We frequently pass custom options into Microcosm to configure Domains and Effects with different options based on the environment. For example, an Effect that auto-saves user data:

class Repo extends Microcosm {
  setup ({ saveInterval }) {
    // ...
    this.addEffect(Autosave, { saveInterval })
  }
}

It can be cumbersome to chase down the default options, which may be specified as defaults in individual domains/effects. With this release, you may now define defaults using the defaults static:

class Repo extends Microcosm {
  static defaults = {
    saveInterval: 5000
  }

  setup ({ saveInterval }) {
    // ...
    this.addEffect(Autosave, { saveInterval })
  }
}

This takes advantage of the Class Fields & Static Properties Spec. This specification is still at Stage 2, however it has become common place to use this feature within React projects. If living on the edge isn't your thing, defaults may also be configured by assigning a default property to your Microcosm subclass:

class Repo extends Microcosm {
  setup ({ saveInterval }) {
    // ...
    this.addEffect(Autosave, { saveInterval })
  }
}


Repo.defaults = {
  saveInterval: 5000
}

All Microcosm specific options, such as maxHistory will get merged into your custom defaults upon construction.

v12.5.0-beta

04 Apr 13:40
Compare
Choose a tag to compare
v12.5.0-beta Pre-release
Pre-release
  • Added a defaults static to Microcosm that passes default options
    to the constructor and setup method.
  • The first argument of setup, the options object passed when
    instantiating a Microcosm argument, will always be an object. There
    is no need to handle the null case for options.
  • Added a strict mode build of Microcosm that ships with development
    assertions. See installation.md for more details

Defaults

We frequently pass custom options into Microcosm to configure Domains
and Effects with different options based on the environment. For
example, an Effect that auto-saves user data:

class Repo extends Microcosm {
  setup ({ saveInterval }) {
    // ...
    this.addEffect(Autosave, { saveInterval })
  }
}

It can be cumbersome to chase down the default options, which may be
specified as defaults in individual domains/effects. With this
release, you may now define defaults using the defaults static:

class Repo extends Microcosm {
  static defaults = {
    saveInterval: 5000
  }

  setup ({ saveInterval }) {
    // ...
    this.addEffect(Autosave, { saveInterval })
  }
}

This takes advantage of
the
Class Fields & Static Properties Spec. This
specification is still
at Stage 2, however it
has become common place to use this feature within React projects. If
living on the edge isn't your thing, defaults may also be configured
by assigning a default property to your Microcosm subclass:

class Repo extends Microcosm {
  setup ({ saveInterval }) {
    // ...
    this.addEffect(Autosave, { saveInterval })
  }
}


Repo.defaults = {
  saveInterval: 5000
}

All Microcosm specific options, such as maxHistory will get merged
into your custom defaults upon construction.

v12.4.0

28 Mar 19:08
Compare
Choose a tag to compare
  • Added repo.history.wait() and repo.history.then() to allow tests
    to wait for all outstanding actions to complete.
  • Added repo.history documentation.

v12.3.1

27 Mar 22:34
Compare
Choose a tag to compare
  • Fix bug where Presenters weren't intercepting actions sent from child views.

Version 12.2.1

20 Mar 20:47
Compare
Choose a tag to compare
  • adding domains does not reset state
  • patching parents with keys owned by children does not patch children
  • patch does not reset state in forks
  • new children props re-render presenters
  • presenter.send method is autobound, allowing it work when passed to children

12.1.1

09 Mar 18:41
Compare
Choose a tag to compare
  • Fixed length caching issue where history would still try to publish changes to an untracked repo.