0.0.5 • Published 6 years ago

@sourcevault/lazybindall v0.0.5

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

Build Status

Install Using Any ..

- npm install lazybindall

- npm install @sourcevault/lazybindall

Type Signature

lazybindall  :: ( ob , methds ) -> obmethds
  • ob <Object> - Methods in methds get bound to Ob.

  • methds <Object> - Object with props that are methods that we want to lock to ob

  • obmethds <Object> is an object whose props are defined be methds and have there context locked to ob.

Simple Example

var foo = {name:"sourcevault"}

var methds = 
	{
		show:function()
		{
			console.log (this)
		}
	}

// ----------------------------------------------

var lazybindall = require ("@sourcevault/lazybindall")

var bound = lazybindall ( foo , methds )

bound.show() // {name:"sourcevault"}

Benchmark

...for 10,000 object with 9 methods

MethodTotal Memory (MB)Time (millisecond)
.prototype631
lazy closure954
eagar closure496,172

|.. view detailed documentation .. | --- |

Updates and API change

  • Initial 0.0.1 release with a single exported function.

License

  • Code released under MIT Licence, see LICENSE for details.

  • Documentation released using CC-BY-4.0 see LICENSE for details.