SlideShare a Scribd company logo
Type Checking in Javascript
with Flow
Yos Riady
yos.io
bit.ly/2Gs04qv
Weak types in JS
What is Flow?
Introduction Flow Types Tools Conclusion
Working with Flow Summary and further
learning
Tooling for Flow
Javascript is weakly typed
{
userName: “Yos”,
favouriteNumber: 42,
interests: [“programming”, “swimming”]
}
Flow is a static type checker
for JavaScript.
Type Annotations
Specify your intentions as type annotations in code, and Flow will check that
everything is behaving as expected.
Weak types in JS
What is Flow?
Introduction Flow Types Tools Conclusion
Working with Flow Summary and further
learning
Tooling for Flow
Variable Types
When you declare a new variable, optionally declare its type.
Function Types
Functions have two places where types are applied: Parameters (input) and the
return value (output).
Maybe Types
Maybe types are for places where a value is optional and you can create them by
adding a question mark in front of the type such as ?string or ?number.
Optional Parameters / Properties
Functions / objects can have optional parameters / properties where a question
mark ? comes after the parameter name.
Literal Types
Flow can also use literal values as types.
Object Types
You can annotate the properties of an object with types.
Reusable Types with Type Aliases
When you have complicated types that you want to reuse in multiple places, you
can alias them in Flow using a type alias.
Union Types
Sometimes it’s useful to create a type which is one of a set of other types.
Interface Types
Importing and Exporting Types
You can export type aliases, interfaces, and classes from one file to another.
Weak types in JS
What is Flow?
Introduction Flow Types Tools Conclusion
Working with Flow Summary and further
learning
Tooling for Flow
Flow Tooling
LinterCompiler
You’ll need to setup a compiler
to strip away Flow types from
your final code.
Install Flow per project to
perform type checking on your
JS files.
Weak types in JS
What is Flow?
Introduction Flow Types Tools Conclusion
Working with Flow Summary and further
learning
Tooling for Flow
Type Checking in Javascript
with Flow
Yos Riady
yos.io
bit.ly/2Gs04qv
Q&A

More Related Content

What's hot

Getting started with typescript and angular 2
Getting started with typescript  and angular 2Getting started with typescript  and angular 2
Getting started with typescript and angular 2
Knoldus Inc.
 
Java Introduction Workshop Day 2
Java Introduction Workshop Day 2 Java Introduction Workshop Day 2
Java Introduction Workshop Day 2
Osama Saad
 
Java Basics
Java BasicsJava Basics
Java Basics
shivamgarg_nitj
 
JetBrains ReSharper
JetBrains ReSharperJetBrains ReSharper
JetBrains ReSharper
Sorin Oboroceanu
 
Value Types
Value TypesValue Types
Value Types
Michael Barker
 
JetBrains ReSharper
JetBrains ReSharperJetBrains ReSharper
JetBrains ReSharper
Dennis Loktionov
 
Data Formats
Data FormatsData Formats
Data Formats
Subhash Chandran
 
Framework Design Guidelines
Framework Design GuidelinesFramework Design Guidelines
Framework Design Guidelines
Mohamed Meligy
 
Real-World Scala Design Patterns
Real-World Scala Design PatternsReal-World Scala Design Patterns
Real-World Scala Design Patterns
NLJUG
 
An overview of JavaScript
An overview of JavaScriptAn overview of JavaScript
An overview of JavaScript
Poluru S
 
Intro to Objective C
Intro to Objective CIntro to Objective C
Intro to Objective C
Ashiq Uz Zoha
 
13243967
1324396713243967
13243967
vijayabharati
 
Resharper - Next Steps
Resharper - Next StepsResharper - Next Steps
Resharper - Next Steps
Timmy Kokke
 
[OOP - Lec 04,05] Basic Building Blocks of OOP
[OOP - Lec 04,05] Basic Building Blocks of OOP[OOP - Lec 04,05] Basic Building Blocks of OOP
[OOP - Lec 04,05] Basic Building Blocks of OOP
Muhammad Hammad Waseem
 
Typescript
TypescriptTypescript
Typescript
Nikhil Thomas
 
Crafting Software with Illegal States Unrepresentable
Crafting Software with Illegal States UnrepresentableCrafting Software with Illegal States Unrepresentable
Crafting Software with Illegal States Unrepresentable
Scott Nimrod
 
C#
C#C#
Jdt Features
Jdt FeaturesJdt Features
Jdt Features
goodfriday
 
TypeScript: Basic Features and Compilation Guide
TypeScript: Basic Features and Compilation GuideTypeScript: Basic Features and Compilation Guide
TypeScript: Basic Features and Compilation Guide
Nascenia IT
 

What's hot (19)

Getting started with typescript and angular 2
Getting started with typescript  and angular 2Getting started with typescript  and angular 2
Getting started with typescript and angular 2
 
Java Introduction Workshop Day 2
Java Introduction Workshop Day 2 Java Introduction Workshop Day 2
Java Introduction Workshop Day 2
 
Java Basics
Java BasicsJava Basics
Java Basics
 
JetBrains ReSharper
JetBrains ReSharperJetBrains ReSharper
JetBrains ReSharper
 
Value Types
Value TypesValue Types
Value Types
 
JetBrains ReSharper
JetBrains ReSharperJetBrains ReSharper
JetBrains ReSharper
 
Data Formats
Data FormatsData Formats
Data Formats
 
Framework Design Guidelines
Framework Design GuidelinesFramework Design Guidelines
Framework Design Guidelines
 
Real-World Scala Design Patterns
Real-World Scala Design PatternsReal-World Scala Design Patterns
Real-World Scala Design Patterns
 
An overview of JavaScript
An overview of JavaScriptAn overview of JavaScript
An overview of JavaScript
 
Intro to Objective C
Intro to Objective CIntro to Objective C
Intro to Objective C
 
13243967
1324396713243967
13243967
 
Resharper - Next Steps
Resharper - Next StepsResharper - Next Steps
Resharper - Next Steps
 
[OOP - Lec 04,05] Basic Building Blocks of OOP
[OOP - Lec 04,05] Basic Building Blocks of OOP[OOP - Lec 04,05] Basic Building Blocks of OOP
[OOP - Lec 04,05] Basic Building Blocks of OOP
 
Typescript
TypescriptTypescript
Typescript
 
Crafting Software with Illegal States Unrepresentable
Crafting Software with Illegal States UnrepresentableCrafting Software with Illegal States Unrepresentable
Crafting Software with Illegal States Unrepresentable
 
C#
C#C#
C#
 
Jdt Features
Jdt FeaturesJdt Features
Jdt Features
 
TypeScript: Basic Features and Compilation Guide
TypeScript: Basic Features and Compilation GuideTypeScript: Basic Features and Compilation Guide
TypeScript: Basic Features and Compilation Guide
 

Similar to Type Checking in Javascript with Flow

Static Type Checking with FlowJs
Static Type Checking with FlowJsStatic Type Checking with FlowJs
Static Type Checking with FlowJs
Unfold UI
 
TypeScript Overview
TypeScript OverviewTypeScript Overview
TypeScript Overview
Aniruddha Chakrabarti
 
TypeScript 101
TypeScript 101TypeScript 101
TypeScript 101
rachelterman
 
Modern_2.pptx for java
Modern_2.pptx for java Modern_2.pptx for java
Modern_2.pptx for java
MayaTofik
 
"Objects validation and comparison using runtime types (io-ts)", Oleksandr Suhak
"Objects validation and comparison using runtime types (io-ts)", Oleksandr Suhak"Objects validation and comparison using runtime types (io-ts)", Oleksandr Suhak
"Objects validation and comparison using runtime types (io-ts)", Oleksandr Suhak
Fwdays
 
Introduction to Core Java Programming
Introduction to Core Java ProgrammingIntroduction to Core Java Programming
Introduction to Core Java Programming
Raveendra R
 
Introduction to JavaScript Programming
Introduction to JavaScript ProgrammingIntroduction to JavaScript Programming
Introduction to JavaScript Programming
Collaboration Technologies
 
Java Tokens
Java  TokensJava  Tokens
Typescript: Beginner to Advanced
Typescript: Beginner to AdvancedTypescript: Beginner to Advanced
Typescript: Beginner to Advanced
Talentica Software
 
Open Source Tools for User Assistance
Open Source Tools for User AssistanceOpen Source Tools for User Assistance
Open Source Tools for User Assistance
Michael McCallister
 
java handout.doc
java handout.docjava handout.doc
java handout.doc
SOMOSCO1
 
Introduction to-programming
Introduction to-programmingIntroduction to-programming
Introduction to-programming
BG Java EE Course
 
Java questions and answers jan bask.net
Java questions and answers jan bask.netJava questions and answers jan bask.net
Java questions and answers jan bask.net
Janbask ItTraining
 
A tour of C# - Overview _ Microsoft Learn.pdf
A tour of C# - Overview _ Microsoft Learn.pdfA tour of C# - Overview _ Microsoft Learn.pdf
A tour of C# - Overview _ Microsoft Learn.pdf
ParasJain570452
 
Introduction to Core Java Programming
Introduction to Core Java ProgrammingIntroduction to Core Java Programming
Introduction to Core Java Programming
Collaboration Technologies
 
Full CSE 310 Unit 1 PPT.pptx for java language
Full CSE 310 Unit 1 PPT.pptx for java languageFull CSE 310 Unit 1 PPT.pptx for java language
Full CSE 310 Unit 1 PPT.pptx for java language
ssuser2963071
 
TypeScript: Angular's Secret Weapon
TypeScript: Angular's Secret WeaponTypeScript: Angular's Secret Weapon
TypeScript: Angular's Secret Weapon
Laurent Duveau
 
TypeScript: Angular's Secret Weapon
TypeScript: Angular's Secret WeaponTypeScript: Angular's Secret Weapon
TypeScript: Angular's Secret Weapon
Laurent Duveau
 
Java script
Java scriptJava script
Java script
Sukrit Gupta
 
List of values Best Practices
List of values Best PracticesList of values Best Practices
List of values Best Practices
Ad Ghauri
 

Similar to Type Checking in Javascript with Flow (20)

Static Type Checking with FlowJs
Static Type Checking with FlowJsStatic Type Checking with FlowJs
Static Type Checking with FlowJs
 
TypeScript Overview
TypeScript OverviewTypeScript Overview
TypeScript Overview
 
TypeScript 101
TypeScript 101TypeScript 101
TypeScript 101
 
Modern_2.pptx for java
Modern_2.pptx for java Modern_2.pptx for java
Modern_2.pptx for java
 
"Objects validation and comparison using runtime types (io-ts)", Oleksandr Suhak
"Objects validation and comparison using runtime types (io-ts)", Oleksandr Suhak"Objects validation and comparison using runtime types (io-ts)", Oleksandr Suhak
"Objects validation and comparison using runtime types (io-ts)", Oleksandr Suhak
 
Introduction to Core Java Programming
Introduction to Core Java ProgrammingIntroduction to Core Java Programming
Introduction to Core Java Programming
 
Introduction to JavaScript Programming
Introduction to JavaScript ProgrammingIntroduction to JavaScript Programming
Introduction to JavaScript Programming
 
Java Tokens
Java  TokensJava  Tokens
Java Tokens
 
Typescript: Beginner to Advanced
Typescript: Beginner to AdvancedTypescript: Beginner to Advanced
Typescript: Beginner to Advanced
 
Open Source Tools for User Assistance
Open Source Tools for User AssistanceOpen Source Tools for User Assistance
Open Source Tools for User Assistance
 
java handout.doc
java handout.docjava handout.doc
java handout.doc
 
Introduction to-programming
Introduction to-programmingIntroduction to-programming
Introduction to-programming
 
Java questions and answers jan bask.net
Java questions and answers jan bask.netJava questions and answers jan bask.net
Java questions and answers jan bask.net
 
A tour of C# - Overview _ Microsoft Learn.pdf
A tour of C# - Overview _ Microsoft Learn.pdfA tour of C# - Overview _ Microsoft Learn.pdf
A tour of C# - Overview _ Microsoft Learn.pdf
 
Introduction to Core Java Programming
Introduction to Core Java ProgrammingIntroduction to Core Java Programming
Introduction to Core Java Programming
 
Full CSE 310 Unit 1 PPT.pptx for java language
Full CSE 310 Unit 1 PPT.pptx for java languageFull CSE 310 Unit 1 PPT.pptx for java language
Full CSE 310 Unit 1 PPT.pptx for java language
 
TypeScript: Angular's Secret Weapon
TypeScript: Angular's Secret WeaponTypeScript: Angular's Secret Weapon
TypeScript: Angular's Secret Weapon
 
TypeScript: Angular's Secret Weapon
TypeScript: Angular's Secret WeaponTypeScript: Angular's Secret Weapon
TypeScript: Angular's Secret Weapon
 
Java script
Java scriptJava script
Java script
 
List of values Best Practices
List of values Best PracticesList of values Best Practices
List of values Best Practices
 

More from Yos Riady

Brief introduction to Serverless (2018)
Brief introduction to Serverless (2018)Brief introduction to Serverless (2018)
Brief introduction to Serverless (2018)
Yos Riady
 
Schema-First API Design
Schema-First API DesignSchema-First API Design
Schema-First API Design
Yos Riady
 
Writing Domain Specific Languages with JSON Schema
Writing Domain Specific Languages with JSON SchemaWriting Domain Specific Languages with JSON Schema
Writing Domain Specific Languages with JSON Schema
Yos Riady
 
GraphQL in an Age of REST
GraphQL in an Age of RESTGraphQL in an Age of REST
GraphQL in an Age of REST
Yos Riady
 
Python List Comprehensions
Python List ComprehensionsPython List Comprehensions
Python List Comprehensions
Yos Riady
 
Ruby on Rails Workshop
Ruby on Rails WorkshopRuby on Rails Workshop
Ruby on Rails Workshop
Yos Riady
 
Online Payments and You
Online Payments and YouOnline Payments and You
Online Payments and You
Yos Riady
 
Entity Component Systems
Entity Component SystemsEntity Component Systems
Entity Component Systems
Yos Riady
 
Introduction to React
Introduction to ReactIntroduction to React
Introduction to React
Yos Riady
 
Intro to Web Map APIs
Intro to Web Map APIsIntro to Web Map APIs
Intro to Web Map APIs
Yos Riady
 

More from Yos Riady (10)

Brief introduction to Serverless (2018)
Brief introduction to Serverless (2018)Brief introduction to Serverless (2018)
Brief introduction to Serverless (2018)
 
Schema-First API Design
Schema-First API DesignSchema-First API Design
Schema-First API Design
 
Writing Domain Specific Languages with JSON Schema
Writing Domain Specific Languages with JSON SchemaWriting Domain Specific Languages with JSON Schema
Writing Domain Specific Languages with JSON Schema
 
GraphQL in an Age of REST
GraphQL in an Age of RESTGraphQL in an Age of REST
GraphQL in an Age of REST
 
Python List Comprehensions
Python List ComprehensionsPython List Comprehensions
Python List Comprehensions
 
Ruby on Rails Workshop
Ruby on Rails WorkshopRuby on Rails Workshop
Ruby on Rails Workshop
 
Online Payments and You
Online Payments and YouOnline Payments and You
Online Payments and You
 
Entity Component Systems
Entity Component SystemsEntity Component Systems
Entity Component Systems
 
Introduction to React
Introduction to ReactIntroduction to React
Introduction to React
 
Intro to Web Map APIs
Intro to Web Map APIsIntro to Web Map APIs
Intro to Web Map APIs
 

Recently uploaded

ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
Project Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdfProject Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdf
Karya Keeper
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
sjcobrien
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
ToXSL Technologies
 
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
kalichargn70th171
 
Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !
Marcin Chrost
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
Alberto Brandolini
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
safelyiotech
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
TaghreedAltamimi
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
dakas1
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
dakas1
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
GohKiangHock
 

Recently uploaded (20)

ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
Project Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdfProject Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdf
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
 
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
 
Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
 

Type Checking in Javascript with Flow

  • 1. Type Checking in Javascript with Flow Yos Riady yos.io bit.ly/2Gs04qv
  • 2. Weak types in JS What is Flow? Introduction Flow Types Tools Conclusion Working with Flow Summary and further learning Tooling for Flow
  • 3. Javascript is weakly typed { userName: “Yos”, favouriteNumber: 42, interests: [“programming”, “swimming”] }
  • 4.
  • 5.
  • 6.
  • 7. Flow is a static type checker for JavaScript.
  • 8. Type Annotations Specify your intentions as type annotations in code, and Flow will check that everything is behaving as expected.
  • 9. Weak types in JS What is Flow? Introduction Flow Types Tools Conclusion Working with Flow Summary and further learning Tooling for Flow
  • 10. Variable Types When you declare a new variable, optionally declare its type.
  • 11. Function Types Functions have two places where types are applied: Parameters (input) and the return value (output).
  • 12. Maybe Types Maybe types are for places where a value is optional and you can create them by adding a question mark in front of the type such as ?string or ?number.
  • 13. Optional Parameters / Properties Functions / objects can have optional parameters / properties where a question mark ? comes after the parameter name.
  • 14. Literal Types Flow can also use literal values as types.
  • 15. Object Types You can annotate the properties of an object with types.
  • 16. Reusable Types with Type Aliases When you have complicated types that you want to reuse in multiple places, you can alias them in Flow using a type alias.
  • 17. Union Types Sometimes it’s useful to create a type which is one of a set of other types.
  • 19. Importing and Exporting Types You can export type aliases, interfaces, and classes from one file to another.
  • 20. Weak types in JS What is Flow? Introduction Flow Types Tools Conclusion Working with Flow Summary and further learning Tooling for Flow
  • 21. Flow Tooling LinterCompiler You’ll need to setup a compiler to strip away Flow types from your final code. Install Flow per project to perform type checking on your JS files.
  • 22.
  • 23. Weak types in JS What is Flow? Introduction Flow Types Tools Conclusion Working with Flow Summary and further learning Tooling for Flow
  • 24. Type Checking in Javascript with Flow Yos Riady yos.io bit.ly/2Gs04qv
  • 25. Q&A