Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@glimmer/tracking

Package Overview
Dependencies
Maintainers
12
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@glimmer/tracking

Glimmer property tracking library

  • 2.0.0-beta.8
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
116K
increased by16.01%
Maintainers
12
Weekly downloads
 
Created

What is @glimmer/tracking?

@glimmer/tracking is a package used in the Glimmer.js and Ember.js ecosystems to provide reactive state management. It allows developers to create reactive properties and track changes to those properties, enabling efficient updates to the UI when the underlying data changes.

What are @glimmer/tracking's main functionalities?

Tracked Properties

The @tracked decorator is used to mark properties that should be tracked for changes. When the property changes, any dependent computations or UI updates are automatically triggered.

class MyComponent {
  @tracked count = 0;

  increment() {
    this.count++;
  }
}

Computed Properties

Computed properties can be created using standard JavaScript getter syntax. These properties automatically recompute when any of their tracked dependencies change.

class MyComponent {
  @tracked firstName = 'John';
  @tracked lastName = 'Doe';

  get fullName() {
    return `${this.firstName} ${this.lastName}`;
  }
}

Tracking Arrays and Objects

Tracked properties can also be arrays or objects. When the array or object is replaced, any dependent computations or UI updates are triggered.

class MyComponent {
  @tracked items = [];

  addItem(item) {
    this.items = [...this.items, item];
  }
}

Other packages similar to @glimmer/tracking

FAQs

Package last updated on 02 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc