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
| expect(received).toEqual(expected) // deep equality | |
| Expected: "0.00" | |
| Received: "12.00" | |
| 10 | | |
| 11 | expect(feetNew.toFixed(2)).toEqual(feet.toFixed(2)); | |
| > 12 | expect(inchesNew.toFixed(2)).toEqual(inches.toFixed(2)); | |
| | ^ | |
| 13 | }; |
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
| <Text | |
| accessibilityRole="header" | |
| > | |
| This is a header | |
| </Text> |
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
| <TouchableOpacity> | |
| Read more! | |
| </TouchableOpacity> |
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 [henchmenState, dispatchHenchmen] = useReducer(henchmenReducer, initialHenchmenState); | |
| ... | |
| const handleHenchmanChange = useCallback((henchman, id) => { | |
| // handle modifying henchmen in reducer | |
| dispatchHenchmen({ |
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 [henchmen, setHenchmen] = useState({}); | |
| ... | |
| const handleHenchmanChange = useCallback((henchman, id) => { | |
| setHenchmen({ | |
| ...henchmen, | |
| [id]: henchman, |
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 handleHenchmanChange = useCallback((henchman, id) => { | |
| dispatchHenchmen({ | |
| type: actions.UPDATE, | |
| payload: { | |
| id, | |
| henchman, | |
| }, | |
| }); | |
| }, [dispatchHenchmen]); |
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 addHenchman = useCallback(id => { | |
| dispatchHenchmen({ | |
| type: actions.ADD, | |
| payload: id, | |
| }); | |
| }, [dispatchHenchmen]); |
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
| def isLeft(bracket): | |
| if bracket == "(": | |
| return True | |
| if bracket == "[": | |
| return True | |
| if bracket == "{": | |
| return True | |
| return False |
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 heroLevelArr = [ | |
| 2, | |
| 4, | |
| 6, | |
| 8, | |
| 11, | |
| 14, | |
| 17, | |
| 20, | |
| 24, |
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
| function toJSON( | |
| value: any, | |
| { pretty }: { pretty: boolean } | |
| ) { | |
| const indent = pretty ? 4 : 0; | |
| return JSON.stringify(value, null, indent); | |
| } |
NewerOlder