Skip to content

Releases: tomasklaen/statin

3.1.0

30 Jan 21:39
Compare
Choose a tag to compare

Features

Full Changelog: 3.0.0...3.1.0

3.0.0

23 Sep 11:31
Compare
Choose a tag to compare

The only change in this version is that you can no longer write into a signal inside a computed signal.

Computed signals should only derive state, not create or modify it. Doing so produces a lot of weird edge cases, undefined behaviors, and errors. Making this explicitly forbidden seems to be the best way forward.

For example, this will now throw an error:

const s = signal(1);
const c = computed(() => {
  const value = s() * 10;
  s(2);
  return value;
});

Before, this would ignore the change signal sent by s(2), causing computed to have a stale state.

2.0.0

26 Jul 08:53
Compare
Choose a tag to compare

This release makes all signals automatically run in an action context, which bulks their effects. This means it is no longer necessary to wrap single signal changes inside an action to prevent duplicate reactions caused by computed properties depended on them:

// Before
action(() => s('foo'));

// After
s('foo'); // automatically bulks effects

This shouldn't make any difference to existing code, but since it does remove setStrict(), which is now unnecessary, it's a major bump.

Breaking

  • Removed setStrict().