part-native: custom class#method

node v0.12.18
version: 2.0.0
endpointsharetweet
var createPart = require('part-native'); function Klass(instanceProp) { this.prop = instanceProp; } Klass.prototype.punctuateProp = function (punctuation) {return this.prop + punctuation;};
var stolenMethod = createPart('Klass.punctuateProp_', Klass); var exclaim = stolenMethod('!');
exclaim({prop: 'cool'});
Loading…

no comments

    sign in to comment