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

reflux-core

v1.0.0

Published

A simple library for uni-directional dataflow application architecture inspired by ReactJS Flux

Downloads

216,162

Readme

reflux-core

A simple core library for unidirectional dataflow architecture inspired by Flux. This module does not depend on React and may be used together with other view engine libraries.

NPM Version NPM Downloads Dependencies Build Status Gratipay

Sauce Test Status

For an overview of reflux with react extensions, look at the refluxjs repository.

Here are the API docs for reflux-core.

Installation

You can currently install the package as an npm package.

NPM

The following command installs reflux-core as an npm package:

npm install reflux-core

ES5

Reflux depends on ES5 features. For older browsers that are missing them you will need a shim such as core-js/es5 from core-js or es5-shim.js from kriskowal's es5-shim.

Development

You need to have NodeJS installed.

  1. Clone this repository

  2. Run npm install

You can run the following npm scripts, for more check the project's package.json file.

  • npm compile Use babel to transpile the ES6 code to ES5, output is /lib.

  • npm test To run the jshint and tests

  • npm run watch To run the watch task. It will lint, compile and test the code whenever a file is saved.

  • npm run benchmark To run the benchmark test

Husky git hooks will prevent bad commits or bad pushes for you by linting and testing the code.

Extending reflux-core

As an add-on

To create an add-on for Reflux, you may do that by creating a callback that Reflux#use can handle.

// addon.js

// The callback recieves an instance of Reflux library that is being used.
export default function(Reflux) {

    // add a simple function to Reflux
    Reflux.createState = function() {
        return {};
    };

}

The user will have to do the following to use the add-on:

import Reflux from "reflux-core";
    // or "reflux" or any other reflux with extensions

import createStateAddon from "./addon.js";

Reflux.use(createStateAddon);

console.log(Reflux.createState());
// outputs {}
  • When publishing the plugin to npm, you don't need to have reflux-core or reflux as a dependency among dependencies in package.json as the user provides the version they use through the Reflux#use method.

  • If you're writing tests, you may want to use reflux-core and put it in devDependencies instead.

  • You may name your library reflux-addon-{name}.

  • Please do provide reflux-addon among keywords in package.json so that users can easily search for your addon in the npm registry.

As extensions for a view library

Install reflux-core as a dependency and publish it as a library to npm. Here is an example entry point:

// index.js
import Reflux from "reflux-core";
import frameworkExtras from "./framework-extras";

Reflux.use(frameworkExtras); // like an add-on

export default Reflux; // export the amended Reflux lib
  • You may name your library reflux-{view library}. E.g. if you're doing mixins for angular then it may be named reflux-angular.

  • Please do provide reflux among keywords in package.json so that users can easily search for your extensions in the npm registry.

Colophon

List of contributors is available on Github.

This project is licensed under BSD 3-Clause License. Copyright (c) 2014, Mikael Brassman.

For more information about the license for this particular project read the LICENSE.md file.

This project uses eventemitter3, is currently MIT licensed and has it's license information here.