javascript - Immutable.js ― custom getter method -


i've got complex object lot of nested properties, , need access specific value. rather replicate code doing every time, use function. there way attach method immutable.js object, return specific value object? or have to use separate function (i.e. func(immobj) rather immobj.get('func')())?

what record?

class abrecord extends record({a:1,b:2}) {   getab() {     return this.a + this.b;   } }  var myrecord = new abrecord({b: 3}) myrecord.getab() // 4 

Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

c++ - Migration from QScriptEngine to QJSEngine -

delphi - Take screenshot in webcam using VFrames in Console Application -