更新时间:2021-07-02 14:03:37
coverpage
Title Page
Copyright and Credits
Hands-On Functional Programming with TypeScript
Dedication
About Packt
Why subscribe?
Packt.com
Foreword
Contributors
About the author
About the reviewers
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Get in touch
Reviews
Functional Programming Fundamentals
Is TypeScript a functional programming language?
The benefits of functional programming
Introducing functional programming
Pure functions
side-effects
Referential transparency
Stateless versus stateful
Declarative versus imperative programming
Immutability
Functions as first-class citizens
Lambda expressions
Function arity
Higher-order functions
Laziness
Summary
Mastering Functions
Function types
Named and anonymous functions
Function declarations and function expressions
Working with function parameters
Trailing commas in function arguments
Functions with optional parameters
Functions with default parameters
Functions with rest parameters
Function overloading
Specialized overloading signature
Function scope and hoisting
Immediately-invoked functions
Tag functions and tagged templates
Mastering Asynchronous Programming
Callbacks and higher-order functions
Arrow functions
Callback hell
Promises
Covariant checking in callback parameters
Generators
Asynchronous functions – async and await
Asynchronous generators
Asynchronous iteration (for await…of)
Delegating to another generator (yield*)
The Runtime – The Event Loop and the this Operator
The environment
Understanding the event loop
Frames
Stack
Queue
Heap
The event loop
The this operator
The this operator in the global context
The this operator in the function context
The call apply and bind methods
The Runtime – Closures and Prototypes
Prototypes
Instance properties versus class properties
Prototypal inheritance
Prototype chains and property shadowing
Accessing the prototype of an object
Closures
Static variables powered by closures
Private members powered by closures
Functional Programming Techniques
Composition techniques
Composition
Partial application
Currying
strictBindCallApply
Pipes
Other techniques
Point-free style
Recursion
Pattern matching