Skip to content
This repository has been archived by the owner on Jun 19, 2022. It is now read-only.

A JavaScript library for persistent, composable, immutable objects!

License

Notifications You must be signed in to change notification settings

alexgs/protoculture-factory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Protoculture Factory

A library for persistent, composable, immutable objects!

Import

let ProtoFactory = require( 'protoculture-factory' );

Object Literals

let immutableObj = ProtoFactory.makeObject()
        .add( 'foo', 12 )
        .add( 'bar', 'xyz' );

console.log( immutableObj.foo + " | " + immutableObj.bar );  // "12 | xyz"
immutableObj.hot = 12;                                       // throws

newObj = immutableObj.set( 'foo', 13 );
console.log( immutableObj.foo + " | " + immutableObj.bar );  // "12 | xyz"
console.log( newObj.foo + " | " + newObj.bar );              // "13 | xyz"

About

A JavaScript library for persistent, composable, immutable objects!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published