Farzad Yousefzadeh
@farzad_yz
type State = {
isLoading: boolean;
accounts: Account[];
error?: string;
};
type State=
| "Idle"
| "Loading"
| "Completed"
| "Failed";
type Data = {
accounts: any[];
errorMessages?: string;
}
👉🏻 State machines and Statecharts
👉🏻 TypeScript
👉🏻 Framework agnostic
👉🏻 Frontend and Backend
👉🏻 Based on SCXML standard
👉🏻 JSON config that ports to other languages
👉🏻 See breadth of features better
👉🏻 Event based architecture
👉🏻 Discover edge cases upfront
👉🏻 Focus on behavior than implementation
👉🏻 Visual model: onboarding, learning code, documentation
👉🏻 Test generation and property based testing
👉🏻 Model a new feature
👉🏻 Refactor an existing feature
👉🏻 Learn a feature by modeling it from a higher level
👉🏻 Test a feature by modeling it for the test scenarios
👉🏻 UI components
👉🏻 Server sequences and workflows like continuous integration
👉🏻 Server controllers or cloud functions where there's asynchronous code and decision trees involved
👉🏻 State orchestration so different machines and actors can pass messages
👉🏻 Not all actors have to be a state machines
👉🏻 XState:fromPromise, fromCallback, fromReducer, fromObservable