Sunday, July 10, 2022

Angular Trips

 

6 Ways to Communicate Between Components in Angular


https://javascript.plainenglish.io/angular-component-communication-81e5e02c6cbe

NgRx
--------
https://ngrx.io/guide/store

Monday, July 4, 2022

React Best practices

React Best practices


https://devsmitra.medium.com/react-best-practices-and-patterns-to-reduce-code-3170f1913b26 

https://devsmitra.medium.com/react-best-practices-and-patterns-to-reduce-code-part-2-rahul-sharma-devsmitra-9186115880b5

https://devsmitra.medium.com/react-best-practices-and-patterns-to-reduce-code-part-3-543b8cef9954


3 React Component Design Patterns You Should Know About


https://medium.com/stackanatomy/3-react-component-design-patterns-you-should-know-about-3f1f48046da4

20 GitHub Repositories to Become a React Master


https://medium.com/@martinageradams/20-github-repositories-to-become-a-react-master-%EF%B8%8F-b91fb3bdd6c8



Javascript cheat sheet

Typescript cheat sheet

https://devsmitra.medium.com/13-typescript-utility-a-cheat-sheet-for-developer-9dfd23cb1bbc


Javascript short functions

https://devsmitra.medium.com/javascript-short-reusable-functions-everyone-will-always-need-10b15f3fa8ca


Javascript quick functions

https://devsmitra.github.io/javascript-quick-functions/#regular-function

Wednesday, February 16, 2022

Javascript one liners

 


Shuffle Array

While using algorithms that require some degree of randomization, you will often find shuffling arrays quite a necessary skill. The following snippet shuffles an array in place with O(n log n) complexity.
const shuffleArray = (arr) => arr.sort(() => Math.random() - 0.5);// Testing
const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
console.log(shuffleArray(arr));

Copy to Clipboard

In web apps, copy to clipboard is rapidly rising in popularity due to its convenience for the user.
const copyToClipboard = (text) =>
navigator.clipboard?.writeText && navigator.clipboard.writeText(text);
// Testing
copyToClipboard("Hello World!");