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

tdispatcher

v1.0.2

Published

simple Flux dispatcher, for huge applications

Downloads

10

Readme

tDispatcher

Flux-Dispatcher, with common API for huge applications

So this project is for guys who are interested to use Flux and do it in a simple way, that might be familiar with other eventsystems. I developed this framework, because I am up to start a new Project, with a lot of complex dataflows between client- and server-application. My decision was already done, to use react. As I am familiar with Backbone and some other frameworks, I thought, how that could integrate with React. Many people use React together with Backbone and replace the views with React. I found, that the standart dispatcher in the Flux-Tutorial has many similarities with Backbone.event or my tMitter. So I changed the tMitter, to hit the queried behaviour as mention at the Flux Website.

Description

This is an Event-system, where events are representing actions and listener can define other listener to be executed first. It will execute one action on all corresponding callbacks, before computing the next action, that might be triggered by a callback. It is possible for an listener to require that one or more Other listener have to be executed before. can also be used as middlewhere, to manipulate the action As soon as all actions are computed, it will trigger an 'dispatched' event, to let views re-render the updated Data in the stores.

API

All you need are three methods, maybe just two of them: on, off and trigger.

	1. tDispatcher.on();// to register a listener,
		// it can be used as a in backbone event just .on('eventname',callback)
		//or better: an object, containing
		{	event:'theEventname',
			name:'nameThatCanBeRequired',
			callback:function(){'toBeExecuted'},
			require:['module that is required']
		}

	2. tDispatcher.off;// to remove eventlistener. .off(),
		//		without params will remove all listener on the Dispatcher
		.off(event)
		//		will remove all listener for that event,(event is a string)
		.off(event, name)
		//		the listener with that name
		.off(event,callback)
		//		will the listener with the corresponding
		//		callback (slow search in a loop)

	3. tDispatcher.trigger() // to execute an event. It will pass the action object to the listeners callback
		//.trigger(name)
		//		call it with a string will execute the listener on that eventname
		//.trigger(name,value)
		//		will pass add the value to the value-key on the action object.
		//.trigger(action)
		//		an object that need to have an event key, as string,
		//		describing the event to be executed and all
		//		other values on other key names, that you want to
		//		pass to the listener.


	4. tDispatcher.addAction(name)
		// name is the name of a new function, that will trigger the event of the same name

##Developer Tobias Nickel
alt text