Socket
Socket
Sign inDemoInstall

smart-mixin

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.2

example/readme/build.sh

2

index.js

@@ -42,3 +42,3 @@ var objToStr = function(x){ return Object.prototype.toString.call(x); };

: function(){
thing.call(this, arguments, thrower);
return thing.call(this, arguments, thrower);
};

@@ -45,0 +45,0 @@ };

{
"name": "smart-mixin",
"version": "1.0.0",
"version": "1.0.2",
"description": "",

@@ -18,2 +18,3 @@ "main": "index.js",

"devDependencies": {
"6to5ify": "^4.0.0",
"expect.js": "^0.3.1",

@@ -20,0 +21,0 @@ "mocha": "^2.1.0",

@@ -1,2 +0,2 @@

# smart-mixin
![travis](https://travis-ci.org/brigand/smart-mixin.svg)

@@ -21,3 +21,3 @@ Mixins with smart merging strategies and errors over silent failure.

// define a mixin behavior
var mixIntoGameObject = ({
var mixIntoGameObject = mixins({
// this can only be defined once, will throw otherwise

@@ -53,3 +53,3 @@ render: mixins.ONCE,

countChickens: mixins.REDUCE_LEFT,
countDucks: mixins.REDUCE_RIGHT
countDucks: mixins.REDUCE_RIGHT,

@@ -105,3 +105,3 @@ // define your own handler for it

class Duck(){
class Duck {
render(){

@@ -118,2 +118,5 @@ console.log(this.getState(5)); // {baz: 4, bar: 6}

mixIntoGameObject(Duck.prototype, mixin);
// use it
new Duck().render();
```

@@ -124,3 +127,3 @@

Nothing too crazy, this was mostly built for use in react-class-mixins, but hopefully
is useful to other people. It's fully tested and ready for production use in node and the browser.
is useful to other people. I'll be adding more test coverage (the mixin.FN apis are fully tested, but not the actual mixin function). Any bug reports will be fixed ASAP.

@@ -127,0 +130,0 @@ # License

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc