Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
observable-lite
Advanced tools
Readme
Simple observable class (similar to watchjs) for use with rivetsjs and other libraries
####Simple Use
// Basic object
var myObj = {
hello: 'world'
};
// Make the object obserable
var observe = new Observable(myObj);
function callback(value, path) {
console.log(value, path);
}
// Listen for changes to 'hello' property
observe.subscribe('hello', callback);
// Update the value of the hello property
observe.set('hello', 'newValue'); // 'newValue', 'hello' logged to console because of subscriber
// Stop listening to changes
observe.unsubscribe('hello', callback);
####Nested Object listening
// Created Object
var nestedObj = {
hello: {
nested: {
fartherNested: {
num: 1234
}
}
}
}
// Make observable
var observe = new Observable(myObj);
function callback(value, path) {
console.log(value, path);
}
// Listen for changes to 'num' property
observe.subscribe('hello.nested.fartherNested.num', callback);
// Update the value of the 'num property
observe.set('hello.nested.fartherNested.num', 5678); // 5678, 'hello.nested.fartherNested.num' logged to console because of subscriber
// Stop listening to changes
observe.unsubscribe('hello.nested.fartherNested.num', callback);
####Subscribers
#####Unsubscribe from all at keypath
observe.unsubscribe('hello')
FAQs
Observable object for use with rivetsjs and other libraries
The npm package observable-lite receives a total of 3 weekly downloads. As such, observable-lite popularity was classified as not popular.
We found that observable-lite demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.