stateDiagram-v2
findAccount: Find Account
moveOutAddress: Move Out Address
meterAndScheduling: Meter & Scheduling
finalBill: Final Bill
reviewAndSubmit: Review & Submit
[*]-->findAccount
state findAccount {
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type InferArguments<T> = T extends (...t: [...infer R]) => Promise<infer X> | |
| ? R | |
| : never; | |
| type InferResults<T> = T extends (...t: [...infer T]) => Promise<infer R> | |
| ? R | |
| : never; | |
| type AnyFn = (...args: any[]) => any; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import Logger from 'src/lib/Logger'; | |
| // Basically we try/catch WrappedComponent render so that we can render ErrorComponent if SSR error is caught | |
| // Reference https://github.com/nayaknotnull/react-isomorphic-error-boundary | |
| type ErrorComponentProps = { | |
| componentName?: string; | |
| error: Error; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const sleep = (ms: number) => | |
| new Promise((resolve, reject) => | |
| // Randomly resolve or reject to test Error | |
| Math.random() < 0.5 ? setTimeout(resolve, ms) : setTimeout(reject, ms) | |
| ); | |
| sleep(5000).then(() => ({ foo: 'bar' })); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Example js tailwind theme object | |
| const theme = { | |
| colors: { | |
| red: { | |
| default: '#1', | |
| dark: '#2' | |
| }, | |
| blue: { | |
| default: '#3', | |
| light: '#4' |