Socket
Book a DemoInstallSign in
Socket

immutable-with-cursors

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

immutable-with-cursors

This is a simple wrapper around [Facebooks immutable data collection library](https://github.com/facebook/immutable-js), adding [Om](https://github.com/swannodette/om)-style cursors.

0.0.1
latest
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

Immutable Data Collections With Cursors

This is a simple wrapper around Facebooks immutable data collection library, adding Om-style cursors.

Cursors are a way of passing around smaller parts of a larger data structure, that will call back to the parent data structure when updated. This is very useful in component-based web libraries (e.g. React), where sub components only should be passed the subset of data that they need, yet must be able to pass updates back up the tree.

Usage example with React.

API

coll.watch(watcher)

Register a watcher to be triggered when the collection is updated.

coll.unwatch(watcher)

Remove a registered watcher.

coll.triggerWatchers(value)

Calls all registered watchers with the passed value, then returns the value.

coll.cursor(keypath, callback, notFoundValue

Creates a cursor at the given keypath and returns it. When the cursor is updated, tha callback is called with the parent collection.

FAQs

Package last updated on 11 Aug 2014

Did you know?

Socket

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.