Immutable.js 4.0.0-rc.9はFlowでもTypeScriptでもgetとsetの文字列を検査してエラーを出します Immutable.jsのRecordについて情報を察知しました. class extendでRecordを継承して独自の型を作るやつです. 生JavaScript版, 型安全も何もない. const { Record } = require("immutable"); class Person extends Record({ name: "", birthday: null }) { get age() { return new Date().getFullYear() - this.birthday.getFullYear(); } 年齢偽装() { return this.set("birthday", new Date("1950-01-01"))
![Immutable.js 4.0.0-rc.9はFlowでもTypeScriptでもgetとsetの文字列を検査してエラーを出します](https://cdn-ak-scissors.b.st-hatena.com/image/square/3bd2cb143b4b0514dee0a986586e0b35904604f8/height=288;version=1;width=512/https%3A%2F%2Fwww.ncaq.net%2Ffavicon.png)