Releases: cesarParra/lwc-signals
v1.4.1
v1.4.0
v1.3.0
v1.2.1
v1.2.0
🚀 Release Notes
Version: 1.2.0
Date: 2024-12-11
✨ Features
- Ability to read a signal value without subscribing to it via the
peek
function. (8dc1db3) - Effects and computed have a default identifier. (74f2521)
- Improved error handling (#22) (8144196)
- isSignal function allows to check if an object is a signal (c6be621)
- Signals can be identified with a symbol through the "brand" property (17f7b10)
🐞 Bug Fixes
- Computed values that return the unchanged value of a tracked signal are now recomputed when the source signal changes. (100308e)
v1.1.1
v1.1.0
🚀 Release Notes
Version: 1.1.0
Date: 2024-11-29
✨ Features
-
Error handling and cyclical dependency management (#20) (97fa7fe)
-
Computed and effects now track if their internal state during their execution. They might be "computing", have an "error" or be "ready".
-
When a circular dependency is detected, an exception is thrown instead of trying the computation, to avoid infinite loops from happening.
-
When an error occurs during an execution of a computed value, the computed goes into an error state, which it keeps until recomputation is done and fixes the issue. This fixes potential infinite loops when executing computed code with errors. Reading a computed in an error state surfaces the error
v1.0.2
v1.0.1
v1.1.0
What's Changed
- Adds Release Workflow by @stanleyzapata in #13
- Introduces the ability to make objects and array changes reactive by "tracking" them by @cesarParra in #12
Summary
To improve that experience, you can now set a track
flag when creating the signal. When set to true, this will make the signal reactive to changes in the object or array properties.
📒 Think about this as using the
@track
decorator in LWC properties. It works the exact same way behind the scenes.
import { $signal } from "c/signals";
const obj = $signal({ x: 1, y: 2 }, { track: true });
const computedFromObj = $computed(() => obj.value.x + obj.value.y);
// When a value in the object changes, the computed value will automatically update
obj.value.x = 2;
console.log(computedFromObj.value); // 4
New Contributors
- @stanleyzapata made their first contribution in #13
Full Changelog: 1.0.0...1.1.0