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

knockout-observablemap

v3.1.0

Published

Observable ES6 Map for Knockout

Downloads

7

Readme

knockout-es6-collections

Observable maps, sets, weak maps and weak sets.

The collections created are:

  • ko.Map
  • ko.Set
  • ko.WeakSet
  • ko.WeakMap

Each of the functions of the keyed collections either observes or mutates the collection.

  | Mutates | Observes --- | --- | --- Map | set, clear, delete | get, has, values, keys, entries, forEach, valueOf Set | add, clear, delete | entries, values, keys, has, forEach, valueOf WeakMap | add, delete, has | valueOf WeakSet | delete, set | has, get, valueOf

The observable is always triggered asynchronously, so multiple updates will be pooled together into one change.

These functions also expose some Knockout observable functions, namely:

  • subscribe(callback[, thisArg]) where the callback receives the entire collection when called
  • valueHasMutated()
  • getSubscriptionCount()

Changelog

31 Mar 2017 - 🐠 3.1.0

  • Fix getSubscription[s]Count
  • Add .peek to the observers e.g. map.values.peek() or map.has.peek('x')
  • NOTE: This version uses () => ... and spreads, so may need transpiling.

28 Feb 2017 - 🦐 3.0.0

  • Fix Set iterator returning entities instead of values
  • Hid all functions behind symbols
  • Gave constructors useful names (instead of all being KeyClass)
  • [3.0.1] Fix Symbol.iterator

12 Aug 2014 – 🌵2.2.0

  • (fix) Tests with canonical Array.from
  • work when Symbol is not defined
  • use ko.tasks.schedule if available

15 Jul 2015 – 🐸 2.1.1

  • Fixed bugs with ko.Set and ko.WeakSet
  • Removed minified version since we have no auto-build process
  • Create instance with either ko.Set(...), etc., or new ko.Set(...)
  • Fixed insertion properties for WeakSet and WeakMap

Test

Run tests with karma start.

Run tests with karma start (or if karma is not installed globally, ./node_modules/karma/bin/karma start).