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

@hecom/button

v1.0.0

Published

Button Register and Management

Downloads

2

Readme

Button

npm version

这是按钮模块的管理,包括注册、取消注册和获取方法。

接口

  • name: string:模块名称。
  • get: (appName, action, state, params) => function:获取应用操作对应的按钮的处理方式。
  • registerGeneral: (appName, action, handle) => void:注册通用的应用操作按钮的处理方式。
  • registerSpecial: (appName, action, special, handle) => string:注册特殊的应用操作按钮的处理方式,返回handleId
  • unregister: (appName, action, handleId) => boolean:取消注册通用或特殊的应用操作按钮的处理方式。
  • ActiononFinish的回调操作键,包括:
    • RefreshList: string:刷新列表。
    • RefreshDetail: string:刷新详情。
    • PopToParent: string:退回上一页

其中special特殊状态判断函数的参数、handle按钮操作处理函数的参数、stateparams获取操作的结果的状态和结果参数,均为如下格式的对象:

  • buttonItem: object:按钮的原始数据配置信息。
  • metaName: string:业务对象的名称。
  • data: object:一条业务数据信息。
  • onFinish: (options) => void:处理后的返回回调方法,options是一个对象,包含Actions中的键,对应值为boolean类型,表示是否调用该功能。