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

@deepexi-devops/stark-data

Package Overview
Dependencies
Maintainers
4
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@deepexi-devops/stark-data

stark-data is a JavaScript library for icestark, used for communication.

  • 0.1.4
  • latest
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

icestark-data

fork from icestark-data

icestark sommunication solution. icestark docs.

Installation

npm install @ice/stark-data --save

API

Store

Global Store, unified management of all variables

  • get(key)
  • set(key, value)
  • on(key, callback, force), when force is true, callback will be called immediately when initializing
  • off(key, callback)
example
// Framework
import { store } from '@ice/stark-data';

const userInfo = { name: 'Tom', age: 18 };
store.set('user', userInfo); // set UserInfo
store.set('language', 'CH');

// Sub-application A
import { store } from '@ice/stark-data';

const userInfo = store.get('user'); // get UserInfo

function showLang(lang) {
  console.log(`current language is ${lang}`);
}

store.on('language', showLang, true); // add callback for 'language', callback will be called whenever 'language' is changed

store.off('language', showLang); // remove callback for 'language'

Event

Global Event, unified management of all events

  • on(key, callback) callback will be called with (...rest)
  • off(key, callback)
  • emit(key, ...rest)
example
// Framework
import { event } from '@ice/stark-data';

function fresh(needFresh) {
  if (!needFresh) return;

  fetch('/api/fresh/message').then(res => {
    // ...
  });
}

event.on('freshMessage', fresh);

// Sub-application A
import { event } from '@ice/stark-data';

event.emit('freshMessage', false);
// ...
event.emit('freshMessage', true);

FAQs

Package last updated on 29 Feb 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