更新时间:2021-07-02 12:34:36
coverpage
Title Page
Copyright and Credits
ReasonML Quick Start Guide
About Packt
Why subscribe?
Packt.com
Contributors
About the authors
About the reviewer
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
Conventions used
Get in touch
Reviews
Introduction to ReasonML
What is ReasonML?
Why Reason?
Support for immutability and purity
Module system
Type system
Cross-platform
Maintainability
Interoperability
ES2030
Community
The Future of ReactJS
Exploring Reason
Data structures and types
Creating our own types
Pattern matching
Making Invalid States Impossible
Summary
Setting Up a Development Environment
The Reason toolchain
Installing BuckleScript
Editor configuration
Setting up a pure Reason project
The bsconfig.json file
The warnings field
The package-specs field
The suffix field
The sources field
Working with DOM
Setting up a ReasonReact project
Improving the developer experience
Creating ReasonReact Components
Component creation basics
Component templates
self
Event handlers
unit
JSX
Props
Children
Life cycles
Subscriptions helper
Stateful components
State action and reducer
Refactoring
Instance variables
Ref and mutable records
Navigation menu
Bindings
Events
Js.t Object
Adding actions
Inline styles
React ref
Velocity
Client-side routing
Current route
Helper functions
Usage
BuckleScript Belt and Interoperability
Module scope
Data structures
Array
Using the Reason standard library
Using the Belt standard library
Using BuckleScript's built-in JavaScript bindings
Using a custom binding
Using raw JavaScript
List
Recursion
Pipe operators
Using Belt
Option module
List module
make
makeBy
shuffle
take
Deck of cards example