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

ios - Is 'init' forbidden as *part* of a variable name? -

javascript - Why Selenium can't find an element that is graphically visible -

qt - Microsoft FTP Service 451 The parameter is incorrect -