npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@quickapp-eco/qappx

v0.1.0

Published

快应用内应用级集中状态管理工具库

Downloads

10

Readme

qappx

快应用内应用级集中状态管理工具库。

受 vuex 的启发,在 vuex 的基础上做了快应用运行环境的相关适配,并对 vuex 的 api 做了一些修改,从而更好到运行在快应用平台上

使用

1. 安装

npm install -S @quickapp-eco/qappx

2. 使用

qappx 的运行依赖于快应用框架前端插件,所以需要快应用框架最小版本 1060+

app.ux 文件:

import { Store, installStore } from '@quickapp-eco/qappx'

// 实例化store
const store = new Store({
  state: {
    name: 'szm',
    detail: {
      height: '185cm',
      weight: '180g'
    }
  },
  getters: {
    height: state => state.detail.height,
    weight: state => state.detail.weight
  },
  mutations: {
    change(state, height) {
      state.detail.height = height
    }
  },
  actions: {
    change(context) {
      context.commit('change', '180cm')
    }
  }
})

// 插件引入
const pageNames = ['Demo', 'Detail'] // 挂载的页面名称
export default {
  plugins: [ installStore(store, { apply : pageNames }) ]
}

3. API 文档

具体 api 说明可参看 API 文档,和 [email protected] 的主要 api 及相关功能特性基本一致。

删除 api:

  1. 构造器选项:
  • strict
  • devtools
  1. 实例方法:
  • watch
  • hotUpdate

新增 api:

  • installStore(store, { apply, exclude })
参数

| 名称 | 说明 | 类型 | 默认值 | | ------------------ | --------------- | ---------------------------------------------- | ---------------------- | | store | 全局 store 实例 | Store | - | | { apply, exclude } | 挂载页面参数 | { apply: String/Array, exclude: String/Array } | {apply:[], exclude:[]} |

注意:store 默认会挂载到快应用到所有页面上,如果考虑到性能问题,只需要挂载到特定的页面到话可以传入方法的第二个参数。 当使用第二个参数时,会优先使用 apply值,如果设置了 apply 时则丢弃 exclude 的值。

{
  apply: ['PageA','PageB'], // 只挂载在 PageA, PageB 页面上
  exclude: ['PageC', 'PageD'] // 排除 PageC, PageD 页面,挂载到其他页面上
}

License

MIT