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

@minlib/minx

v2.0.1

Published

state management for min

Downloads

4

Readme

root的结构 root: { state: { // 按路径(namespace)合并了子modules里的state id0 id1 a: { id2 } a/b: { id3 } }, getters: { // 合并了子modules里的state(暂未支持namespace) getterId0 getterId1 getterId2 getterId3 }, actions: { // 合并了子modules里的actions(暂未支持namespace) actionId0 actionId1 }, mutations: { // 合并了子modules里的mutations(暂未支持namespace) mutationId0 mutationId1 } ... }

mapState store里的state不是函数 1、 computed: { ...mapState([ 'a' // 对应this.$store.state.a ]) } 2、 computed:{ ...mapState({ count: state => state.count, countAlias: 'count', // 重命名;'count' 等同于 state => state.count countPlusLocalState (state) { // 为了能够使用 this 获取局部状态,必须使用常规函数 return state.count + this.localCount } }) }

mapGetters store里的getters本就都是函数 1、 computed:{ ...mapGetters([ 'a' // 对应this.$store.getters.a ]) } 2、 computed:{ ...mapGetters({ countAlias: 'count', // 重命名;对应this.$store.state.count }) }

mapMutations 1、 methods:{ ...mapMutations([ 'add', // 将 this.add() 映射为 this.$store.commit('add') 'add2' // 支持传参;调用时用this.add2(data) 会映射为 this.$store.commit('add2', data) ]) } 2、 methods: { ...mapMutations({ add: 'addOnce', // 将 this.add() 映射为 this.$store.commit('addOnce') addFunc (commit, data) { // 会把commit作为第一个参数回传 ... } }) }

调用 a、未使用mapMutations时的调用姿势: this.$store.commit('add', { a, b }) b、使用后调用姿势: this.add({ a, b }) this.addFunc({ a, b })

测试 http://www.liuyiqi.cn/2017/11/09/how-to-test-dom-manipulation/