git config --global rerere.enabled true
git pull origin main git rebase main
@comment now fix conflicts manually only once, since git rerere will record your chosen conflict resolutions
git push -f
| // BE does the feature flags for users for A/B testing | |
| <FeatureFlag isEnabled={flagValue}> | |
| // Content for a specific feature flag | |
| </FeatureFlag> | |
| const FeatureFlag = ({ isEnabled, children }) => { | |
| return isEnabled ? children : null; | |
| } |
| const path = require('path') | |
| const libPath = path.join(require.resolve('./my-library/another'), '..') | |
| // console.log('libPath :: ', libPath) | |
| const anotherPath = path.join(libPath, 'another') | |
| const another = require(anotherPath) | |
| // console.log('anotherPath ::', anotherPath) | |
| // console.log('another ::', another) |
| before(() => { | |
| cy.clearInfo(); | |
| cy.login(); | |
| }); | |
| after(() => { | |
| cy.contains('Logout').click(); | |
| cy.contains('Login'); | |
| }); | |
| beforeEach(() => { |
| // ignore this line, this is just here | |
| // to clear console, everytime I hit "Run with JS" | |
| console.clear(); | |
| // Comment out each example one by one & play with | |
| // it, happy coding :) | |
| // @example NOT* a closure example | |
| // function person() { | |
| // let name = 'adeel'; |
| // ### EXAMPLE 1 | |
| // -- what you type | |
| // var name = 'adeel'; | |
| // var profession = 'developer'; | |
| // console.log(name + ' ' + profession); | |
| // -- what the machine does | |
| // var name; // undefined | |
| // var profession; // undefined; | |
| // name = 'adeel'; |
| // Understanding array methods:- | |
| // - filter | |
| // - map | |
| // - some | |
| // - every | |
| // - reduce | |
| let myOrgArray = [1,2,3, 4, 5, 6, 7, 8, 9, 10]; | |
| // Discussing array by reference |
There are multiple ways, but all of them start from here react-scripts
By default when you do
npx create-react-app my-app
| /** | |
| * @description Hacky implementation for ignoring | |
| * @param {Function} callback | |
| * @param {Array of primitive dependencies} deps, because | |
| * Arrays & Objects don't work in useEffect deps | |
| */ | |
| const useIgnore = (callback, deps) => { | |
| const [{success, error, loading}, setState] = React.useState({ | |
| success: null, | |
| error: null, |