Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@glimmer/validator
Advanced tools
@glimmer/validator is a package used in the Glimmer.js ecosystem to provide reactive state management and validation. It allows developers to create reactive properties and track changes to them, ensuring that the UI stays in sync with the underlying data model.
Tracking Changes
This feature allows you to track changes to properties. When a tracked property changes, any dependent properties or computations are automatically updated.
const { tracked } = require('@glimmer/validator');
class Person {
@tracked firstName;
@tracked lastName;
constructor(firstName, lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
get fullName() {
return `${this.firstName} ${this.lastName}`;
}
}
let person = new Person('John', 'Doe');
console.log(person.fullName); // John Doe
person.firstName = 'Jane';
console.log(person.fullName); // Jane Doe
Validation
This feature allows you to validate properties using custom logic. The `@validate` decorator can be used to create computed properties that validate the state of other properties.
const { tracked, validate } = require('@glimmer/validator');
class User {
@tracked email;
constructor(email) {
this.email = email;
}
@validate
get isValidEmail() {
return /^[^@]+@[^@]+\.[^@]+$/.test(this.email);
}
}
let user = new User('test@example.com');
console.log(user.isValidEmail); // true
user.email = 'invalid-email';
console.log(user.isValidEmail); // false
MobX is a state management library that makes it simple to connect the reactive data of your application with the UI. It provides similar reactive state management capabilities as @glimmer/validator but is more widely used and has a larger community.
Vue.js is a progressive JavaScript framework for building user interfaces. It includes a reactivity system that is similar to @glimmer/validator's tracking and validation features. Vue's reactivity system is more integrated into the framework, providing a more comprehensive solution for building reactive applications.
Redux is a predictable state container for JavaScript apps. While it does not provide the same automatic reactivity as @glimmer/validator, it offers a robust way to manage application state and can be combined with libraries like React to achieve similar reactive behavior.
v0.78.0 (2021-04-15)
@glimmer/compiler
, @glimmer/integration-tests
, @glimmer/interfaces
, @glimmer/opcode-compiler
, @glimmer/syntax
@foo={{helper}}
(@chancancode)@glimmer/integration-tests
, @glimmer/opcode-compiler
, @glimmer/runtime
FAQs
Objects used to track values and their dirtiness in Glimmer
The npm package @glimmer/validator receives a total of 0 weekly downloads. As such, @glimmer/validator popularity was classified as not popular.
We found that @glimmer/validator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 14 open source maintainers collaborating on the project.
Did you know?
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.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.