Socket
Socket
Sign inDemoInstall

immutable-records

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    immutable-records

Immutable Records (faster than immutable.js)


Version published
Maintainers
1
Install size
9.92 kB
Created

Readme

Source

immutable-records

npm version A simple implementation of immutable records for JavaScript.

The goal of this implementation is to have great performance dealing with records with a small, fixed set of attributes. See here for a performance comparision with Facebook's immutable-js.

This is the JavaScript version of the TypeScript version for use with npm.

Install (via NPM)

$ npm install immutable-records

Usage

var Record = require('immutable-records').Record;

var ABRecord = Record({a:1, b:2});
var myRecord = new ABRecord({b:3});

myRecord.get('b'); // 3

myRecord = myRecord.set('a', 4); // Returns a new Record
myRecord.get('a'); // 4

myRecord.toJS(); // Returns a vanilla JS Object { a: 4, b: 3 }

Keywords

FAQs

Last updated on 06 Feb 2016

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