Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

homing

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

homing

Homing.

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

homing

这是一个强大的响应式库,使您能够轻松观察和响应对象属性的更改。

✨特性

  • 轻松观察: 使任何对象变为可观察的,无论是简单对象还是数组。
  • 自动运行: 当观察的对象发生变化时,自动执行相关的操作。

📦安装

npm install homing

使用

使对象变为可观察的

import { observable } from 'homing';

const obj = observable({
  name: 'Alice',
  age: 25
});

class Store {
    count = 0
    
 	constructor() {
        return observable(this);
    }
}

const store = new Store()

自动响应更改

import { autorun } from 'homing';

const data = observable({
  count: 0
});

autorun(() => {
  console.log(data.count);
});

data.count = 5; // Console: 5

Keywords

typescript

FAQs

Package last updated on 21 Nov 2023

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