Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Static type checking with immutable.js and Facebook flow

At the time of writing, you can use the two together by grabbing the interface file from here:

https://github.com/facebook/immutable-js/blob/master/type-definitions/immutable.js.flow

  1. Create a directory within your project, for example interfaces.
  2. Create a .flowconfig if it doesn't exist, and add the following lines

.flowconfig

[libs]
interfaces/

This will look in the ./interfaces/ directory for Flow definitions.

Although linking to a resource is frowned upon on SO, it that case it makes sense as that will be the most up to date (I'm assuming FB will keep it update as they update the core library)


Edited to add that flowtypes have been added since most recent major version.

Original answer:

Looks like integration between Flow and Immutable.js is in development but not yet complete.