javascript - Basic example of how to use ImmutableJS Records with Flow -
in following example, i'd expect every .get()
, .set()
call have flow error, couple do:
const abrecord = record({ a: 1, b: 2 }); const myrecord = abrecord({ b: 3 }); const c = myrecord.get("c"); // error const d: string = myrecord.get("a"); // no error myrecord.set("c", 4); // error myrecord.set("a", "a string"); // no error
am missing annotations solve this?
Comments
Post a Comment