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 -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -