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
| /* | |
| For my use only but happy to explain it to anyone interested: | |
| I'm not into use controlled components everywhere. | |
| Forms collects the values and submit does... well submit. | |
| Because of React twisted events (synthetic) this approach uses: | |
| - every input has a unique name | |
| - then you will get obj vith name: value keys | |
| - you can specify which name should be picked up |
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 makeSmallArrays = count => [ ...(new Array(count)) ].map((_, i) => [i, i.toString()]); | |
| // generate arrs | |
| // a lot of small ones | |
| const countSmall = 1000; | |
| arrOfSmalls = makeSmallArrays(countSmall); | |
| // cost of duplicating array | |
| const fnConcat = arr => arr.concat(); |
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
| unless Life.include?(:happines) | |
| raise WorldMismatchError | |
| end |
NewerOlder