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

minimal-flux-stores

v0.1.1

Published

Stores for minimal-flux

Downloads

5

Readme

minimal-flux-stores

Immutable stores for minimal-flux. Work in progess!

Travis David NPM

Install

npm install minimal-flux-stores --save

Stores

  • ImmutableStore extends minimal-flux.Store
    • Stores immutable data
  • CollectionStore extends ImmutableStore
    • Stores and indexes a collection of items
  • ResourceStore extends CollectionStore
    • Manages a remote collection, for example via REST
    • Similar to Backbone.Collection

Actions

  • CollectionActions extends minimal-flux.Actions
    • Provides predefined actions for CollectionStore
    • Actions: add, change, remove
  • ResourceActions extends CollectionActions
    • Provides predefined actions for ResourceStore
    • Actions: fetch, fetchSuccess, fetchError, create, createSuccess, createError, createValidationError, update, updateSuccess, updateError, delete, deleteSuccess, deleteError
    • Needs an adapter to communicate with a server, e.g. RestAdapter

Adapters

  • Adapter
    • Abstract adapter for ResourceActions
  • RestAdapter extends Adapter
    • Implements read, create, update, delete for use with a REST-API

Performance

minimal-flux-stores is developed with performance in mind. The stores are benchmarked against the well performing Backbone.Collection. See the results:

target | ops/sec | variance | runs ------- | -------:| --------:| ----: ResourceStore#add 1 | 25,231 | ±3.00% | 62 ResourceStore#add 2 | 10,506 | ±4.14% | 58 ResourceStore#add 32 | 678 | ±3.79% | 72 ResourceStore#add 1024 | 19.03 | ±4.55% | 36 ResourceStore#add 2 batch | 11,932 | ±3.88% | 54 ResourceStore#add 32 batch | 1,061 | ±2.52% | 70 ResourceStore#add 1024 batch | 31.86 | ±2.66% | 43 CollectionStore#add 1 | 45,753 | ±4.68% | 54 CollectionStore#add 2 | 23,905 | ±3.97% | 65 CollectionStore#add 32 | 1,548 | ±3.20% | 76 CollectionStore#add 1024 | 47.64 | ±2.08% | 54 CollectionStore#add 2 batch | 33,084 | ±2.98% | 63 CollectionStore#add 32 batch | 3,556 | ±3.08% | 74 CollectionStore#add 1024 batch | 132 | ±2.89% | 71 Backbone.Collection#add 1 | 54,153 | ±1.96% | 84 Backbone.Collection#add 2 | 28,445 | ±2.42% | 79 Backbone.Collection#add 32 | 1,741 | ±1.89% | 82 Backbone.Collection#add 1024 | 50.19 | ±2.78% | 55 Backbone.Collection#add 2 batch | 35,869 | ±1.82% | 89 Backbone.Collection#add 32 batch | 2,605 | ±1.93% | 82 Backbone.Collection#add 1024 batch | 86.83 | ±3.34% | 67

To run the benchmarks, make sure you have installed all dependencies. Then run npm run perf in the root directory

Examples

You can find more examples in examples/. Run the following commands to make the examples work:

# Run install for minimal-flux-stores in the root directory
npm install
# Change to one of the examples
cd examples/<example>
# Install example dependencies
npm install
# Start the server
npm start

Then open the http://localhost:3000 in your browser.