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 🙏

© 2026 – Pkg Stats / Ryan Hefner

song-flux

v0.1.1

Published

A dispatcher to use with SOng Flux

Readme

SOng Flux

A library to implement the flux architecture with AngularJS.

Dispatcher

The SOng-Flux dispatcher mirror's facebooks pretty closely. The main differences are the option to have one dispatcher per module and the mechanism for registering with the dispatcher. With the ability to create a dispatcher per module you have the option of either strictly following the more traditional "one dispatcher per application" convention or having multiple dispatchers. To register with the dispatcher SOng-Flux eschews "constants" for an action's constructor.

getDispatcher

To get the dispatcher your module should depend on the songFlux module. Then inject songFactory and call:

songFactory.getDispatcher(<moduleName>)

The dispatcher will be a singleton per module and will throw if the module is not present in the application.

register

To register an action with the dispatcher use the register function. The register function takes two parameters an action constructor function used to identify the action and the callback. The return is an id for deregistering and/or using the waitFor function.

unregister

The unregister function has the exact same API as facebook's dispatcher were the only parameter is the id that was returned from the register function.

dispatch

When dispatching you must pass an instance of an action as the parameter. The action's constructor must have been used to register with the dispatcher, this means that as long as an instance object's .constructor property matches a registered action it will dispatch correctly.

waitsFor

waitsFor is the same as facebook's dispatcher, used when you need a registered callback to be completed before the callback being registered can be executed. When register a callback, inside the callback call the waitsFor function with the dependent id to make sure it has been executed before proceeding.

Requirements

SOng-Flux makes use of basic WeakMap functionality, this means that browser support for IE is 11+.

Extras

SOng-Flux comes with some extra utilities to aid the implementation of the flux architecture. These are completely optional, and will add functionality to the songFactory when the script is loaded.

o-action

O-actions supply a convention for actions. It adds a createAction function to the songFactory, which takes an action constructor and a module name for what dispatcher to use. The createAction function will return a factory function for the action that takes the same parameters as the action. The return of the factory function itself will be an instance of the action with a dispatcher property to allow changing the dispatcher for that action. It will also have a dispatch method that will dispatch itself.