Socket
Socket
Sign inDemoInstall

knockout-observablemap

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    knockout-observablemap

Observable ES6 Map for Knockout


Version published
Maintainers
1
Install size
15.1 kB
Created

Readme

Source

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.

 MutatesObserves
Mapset, clear, deleteget, has, values, keys, entries, forEach, valueOf
Setadd, clear, deleteentries, values, keys, has, forEach, valueOf
WeakMapadd, delete, hasvalueOf
WeakSetdelete, sethas, 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).

Keywords

FAQs

Last updated on 01 Apr 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc