Skip to content

Releases: foxdonut/meiosis

meiosis-setup v6.0.0

08 Sep 12:18
Compare
Choose a tag to compare

meiosis-setup v6.0.0

Meiosis-Router-Setup 1.0.0-alpha.0

27 Dec 14:51
Compare
Choose a tag to compare
working on router setup

Meiosis-Setup v5.1.2

13 Dec 21:37
Compare
Choose a tag to compare

Fix bug in simple stream where an Effect on the initial state did not trigger another update and the Effect.

Meiosis-Setup v5.1.1

23 Nov 00:17
Compare
Choose a tag to compare
  • Add patch type to Mergerino setup.

Meiosis-Setup v5.1.0

22 Nov 20:49
Compare
Choose a tag to compare
  • TypeScript support
  • new nest function
  • bug fixes
  • backward compatible with v5.0.0

Meiosis-Setup 5.0.0

17 Jun 23:51
Compare
Choose a tag to compare

Meiosis-Setup 4.0.0

22 Mar 12:57
Compare
Choose a tag to compare

Meiosis-Setup Release 4.0.0

https://github.com/foxdonut/meiosis/tree/master/helpers/setup

Release Notes

Migrating from version 3 to version 4

Version 4 of meiosis-setup works a little differently than version 3. Here are the changes and
steps to migration:

Services

In version 3, services returned:

({ state?, patch?, render?, next? })

Respectively indicating:

  • a patch to change the state
  • a different patch
  • aborting the render
  • the next update to run.

In version 4, services return:

patch?

Only a patch to change the state. Thus, services from version 3 should be changed to directly return
what they were returning under { state }:

// version 3
return { state: <patch>, ... };

// version 4
return <patch>;

See below for migrating { patch, render, next }.

Aborting a Patch

In version 3, a service could return { patch: false } to abort a patch, or { patch: newPatch } to
abort the current sequence and issue a different patch.

In version 4, the incoming patch should not be changed. Instead, a service can return a patch that
reverts to the previous state to abort a patch. The current sequence cannot be aborted, but an
effect (see below) can be used to issue another patch.

Preventing a Re-Render

In version 3, a service could return { render: false } to prevent a re-render.

In version 4, a service can achieve the same result by returning a patch that reverts to the
previous state. Indeed, when the final state after services have applied their patches is the same
as the previous state, the view is not re-rendered.

Effects

In version 3, services could return { next: fn } to indicate a function that can trigger updates
after the current sequence.

In version 4, these are moved to separate effects. The function signature is the same, except
that the function also receives previousState, becoming:

({ state, previousState, patch, update, actions }) => {
  // ...
}

To use effects, specify an array of effect functions in the effects property of the app object:

// version 3
const app = {
  services: [
    (/* ... */) => {
      // ...
      return {
        next: fn1
      };
    },
    (/* ... */) => {
      // ...
      return {
        next: fn2
      };
    }
  ]
}

// version 4
const app = {
  services: [/* ... */],
  effects: [fn1, fn2]
}

Meiosis v1.4.1

08 May 12:35
Compare
Choose a tag to compare

Add unpkg hint -- thanks @porsager

Meiosis v1.3.0

30 Mar 02:52
Compare
Choose a tag to compare

This is Meiosis v1.3.0.

  • Added toUpdate to be able to configure different types of updates.

Meiosis v1.2.0

09 Nov 00:29
Compare
Choose a tag to compare

This is Meiosis v1.2.0