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

sati-dispatch

v3.3.3

Published

This is a simple but useful dispatch module

Downloads

12

Readme

sati-dispatch

Small, simple and common dispatch create by laidx;

一个小巧,通用的dispatch库,是一个自定义事件调度器,支持on,call,apply,支持命名空间管理。

支持申明式:先调用register注册所有事件,再调用on,call等方式使用。
非严格模式:无需register,引入后调用on的同时注册事件。
通过new Dispatch(options)时,设置options的strict属性(boolean)。

前言

laidx(boom),前端小白菜一枚,纪念下在我入行8个月左右,发布了我的第一个npm包吧 (ゝ∀・)b

目的是解决: 想要使用d3-dispatch,或者vue的eventbus等等类似的事件调度器时,又不需要完整的引入像d3,vue等如此巨大的库。

因此,就自己实现了一个没有任何依赖的小巧的dispatch,一如常用的使用方法通过npm或者浏览器脚本引入。

Installing

If you use npm.For example:

npm install sati-dispatch;

Get start

import * as Dispatch from 'sati-dispatch';

Import Dispatch

const dispatch = new Dispatch();

API

  • [register] - Register events in strict mode

  • [on] - Listent the event and set a callback function.The function will be trigger When event is dispatched

  • [call] - Afferent a eventName(can be namespace) and trigger this event when it has been matched

  • [apply] - just like [call].The only different is the parameter in callback function was array.

  • [remove] - Remove event by name and it will remove the all callback functions in thie namespace.