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

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

java - How to compare two classes -

mysql - Gateway Timeout Error on Insert 70000 record using Hibernate in Java -