Skip to content

Conversation

@mbeckem
Copy link
Member

@mbeckem mbeckem commented Aug 8, 2025

The new decorators support the creation of hidden signals using a convenient API:

import { reactiveProperty, computedProperty } from "@conterra/reactivity-decorators";

class ReactiveClass {
    // The value is wrapped in a reactive() internally
    @reactiveProperty
    accessor value = 3;

    // The getter is wrapped in a computed().
    @computedProperty
    get doubleValue() {
        return this.value * 2;
    }
}

const object = new ReactiveClass();
object.value = 4; // reactive
object.doubleValue; // computed property, reactive

@changeset-bot
Copy link

changeset-bot bot commented Aug 8, 2025

⚠️ No Changeset found

Latest commit: 715518d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@mbeckem mbeckem force-pushed the feature/decorators branch from d332fc1 to 3219442 Compare August 8, 2025 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants