Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fluid-experimental/attributable-map

Package Overview
Dependencies
Maintainers
0
Versions
224
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fluid-experimental/attributable-map

Distributed map

  • 2.0.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
547
increased by139.91%
Maintainers
0
Weekly downloads
 
Created
Source

@fluid-experimental/attributable-map

IMPORTANT: This package is experimental. Its APIs may change without notice.

Do not use in production scenarios.

Overview

This experimental DDS is a copy of SharedMap which additionally tracks attribution information, such as the user who made an update and the timestamp of the change. Please refer to the description of attributor for more details.

SharedMap

The SharedMap distributed data structure can be used to store key-value pairs. It provides the same API for setting and retrieving values that JavaScript developers are accustomed to with the Map built-in object.

Creation

To create a SharedMap, call the static create method:

const myMap = SharedMap.create(this.runtime, id);

Usage

Unlike the JavaScript Map, a SharedMap's keys must be strings. The value must only be plain JS objects or handles (e.g. to another DDS or Fluid objects).

In collaborative scenarios, the value is settled with a policy of last write wins.

Eventing

SharedMap is an EventEmitter, and will emit events when other clients make modifications. You should register for these events and respond appropriately as the data is modified. valueChanged will be emitted in response to a set or delete, and provide the key and previous value that was stored at that key. clear will be emitted in response to a clear.

FAQs

Package last updated on 29 Jul 2024

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

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc