New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

nomix

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nomix

[nomix](https://github.com/vzt7/nomix) 是一个基于 [@preact/signals-core](https://github.com/preactjs/signals) 的小程序状态管理工具。

latest
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

nomix

nomix 是一个基于 @preact/signals-core 的小程序状态管理工具。

Install

# with npm
npm i nomix


# with yarn
yarn add nomix


# with pnpm
pnpm i nomix

Usage

nomix 仅额外提供 createStore 方法用于处理小程序状态更新和类型提示,其他 API 及使用方法参考 @preact/signals-core

import { createStore, signal, computed } from 'nomix';

const user = signal({
  name: 'unknown',
  id: '0',
});

const username = computed(() => {
  const { name, id } = user.value;
  return `${name}#${id}`;
});

const userStore = createStore({
  username,
});

Component({
  behaviors: [userStore.behaviors],
  data: {
    // 用于给 Typescript 项目提供类型提示( JS 项目可不传 )
    ...userStore.initialState,
  },
});

Keywords

wx

FAQs

Package last updated on 23 May 2024

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