Last active
July 29, 2019 15:48
-
-
Save SebDuf/7dc609b258b2a933201ee2c6fbc450f9 to your computer and use it in GitHub Desktop.
Revisions
-
SebDuf revised this gist
Jul 29, 2019 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -7,6 +7,7 @@ function getUserFriends(state): Friends[] { function getUserFriends(state): Friends[] { const friends = []; // Please never do this; it's only to illustrate the point for (let count = state.me.friendCount; i <= state.me.friendCount; i++) { friends.push(state.me[`friend-${count}`]); } -
SebDuf revised this gist
Jul 29, 2019 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,9 @@ // Before function getUserFriends(state): Friends[] { return state.me.friends; } // After function getUserFriends(state): Friends[] { const friends = []; -
SebDuf created this gist
Jul 29, 2019 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ function getUserFriends(state): Friends[] { return state.me.friends; } function getUserFriends(state): Friends[] { const friends = []; for (let count = state.me.friendCount; i <= state.me.friendCount; i++) { friends.push(state.me[`friend-${count}`]); } return friends; }