New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

arida

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arida

一个用于数据订阅的工具库,尤其适用于扩展react,以允许子组件可以订阅父组件的数据,当父组件的数据更新时,及时更新子组件数据。

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Introduction

A libabry for subcribing data what you'r interesting. when the part of data what you have subcibed has changed, the callback you have registered will be triggered. This is a data flow libary extends flux or reflux, you can pass data from compontents to its children or sibings.

Install

npm install arida

Usage example

import arida from 'arida';
const source = {name: 'aa', id: 2, dept: 'math'};
arida.init(source);
arida.subcribe(['name', 'id'], (payload) => {
  console.log(payload);
});
arida.update({
  name: 'lucy',
});
arida.update({
  dept: 'chinese',
});

Run the example above, you will get {name: 'lucy'} on your console.

API

The following is an incomplete list of arida API. It should give you a general concept of arida's usage.

  • .init(object): Returns target object;
  • .subcribe(keys, callback): subcribe the key(string) or keys(array), even an object that you'r interesting;
  • .update(data): update date and dispatch its changes to observers;
  • .get(): Returns target object;

Contributing

We welcome all contributions, please submit any ideas as pull requests or as a GitHub issue.

Licence

MIT

Keywords

FAQs

Package last updated on 31 Mar 2016

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