Why ​use flow?

Type checking

Static Typisation

dynamic Typisation

Error handling on compilation phase

Error handling on running phase (runtime error)

You can proactively find bugs and errors

Why ​use flow?

Self-documentation

You do not need jsdoc

// @flow
function calculatePayoutDate(
  quote: boolean,
  amount: number,
  paymentMethod: string): Date {
  let payoutDate;
    
  /* business logic */

  return payoutDate;
}
/*
  @function Determines the payout date for a purchase
  @param {boolean} quote - Is this for a price quote?
  @param {boolean} amount - Purchase amount
  @param {string} paymentMethod -
  Type of payment method used for this purchase
*/
function calculatePayoutDate(quote, amount, paymentMethod) {
  let payoutDate;
  /* .... Business logic .... */

  return payoutDate;
};

Why ​use flow?

and more

confident to carry out the refactoring

easy integration to a project

active development team (Facebook, 30 commits everyday)

IDE integration

reduce amount of unit tests

Why not ​use flow?

you need to learn API

write more code x2, x3

delay development phase

spend time to be a master

When ​use flow?

very important for you business (maintainable, scalable)

there is a development team

the architecture is complicated and has many features

will be refactored to follow tech trends

When not ​use flow?

the program is short-lived and critically unimportant

you are alone developer

the app is easy and small

the app is a prototype

What to do to start to ​use flow?

Implement to a project/growing project

create npm scripts to check

integrate with IDE

include presets

not necessary to connect with a watcher

you have 3 weeks 😊

write at least 1 component

installation

Made with Slides.com