See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope> is optional
| "use strict"; | |
| // ================================================= | |
| // a common question that pops up is | |
| // 'why do my async functions use the final value of my loop variable instead of the one they are called with'? | |
| // its because they refer directly to the loop variable and its last value | |
| // the solutions are various ways to bind the loop variable in a new scope | |
| // | |
| // this gist shows different ways to handle a loop that spawns an async function that depends on the loop index | |
| // ================================================= |
| // Function form the react-native-image-picker library | |
| ImagePicker.showImagePicker({ title: 'Select Image' }, (response) => { | |
| // format the image data | |
| const image = { | |
| uri: response.uri, | |
| type: 'image/jpeg', | |
| name: 'myImage' + '-' + Date.now() + '.jpg' | |
| } | |
| // Instantiate a FormData() object | |
| const imgBody = new FormData(); |
| // HOW TO RUN IT ON GOOGLE CHROME | |
| // 1. OPEN INSTAGRAM | |
| // 2. OPEN LIST OF FOLLOWERS | |
| // 3. OPEN DEVELOPER TOOLS | |
| // 4. COPY EVERYTHING HERE CTRL + A | |
| // 5. PASTE EVERYTHING IN DEVELOPER TOOLS CONSOLE | |
| // 6. CLICK ENTER | |
| // THERE YOU WILL SOON HAVE NO FRIENDS | |
| const FOLLOWING_BUTTON_TEXT = 'フォロー中' // CHANGE THIS TO YOUR LANGUAGE |