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? -

c# - Get the Class name in a class with atribute inside a attribute method -

file - Python: AttributeError: 'str' object has no attribute 'readlines' -