React Native – Testing (3)
How to fix “Received number of calls: 0” when testing a class method? Ref: inner-functions-with-jest How to mock a class to return a function instead […]
How to fix “Received number of calls: 0” when testing a class method? Ref: inner-functions-with-jest How to mock a class to return a function instead […]
How to create Apollo client for multiple graphQL endpoints? Create HttpLink to each endpoint Configure Apollo client Finally, you can call a query or mutation […]
How to interact with a HTML element in React? Use useRef Embed HTML content Focus an editable div element How to render a React component […]
What can Webpack do? Bundle multiple js files into 1 js file with correct js file order Bundle multiple css, images,… files into 1 js […]
How to add a delay inside a loop? Asynchronous process Synchronous process for… while… How to sort an array effeciently? Use https://github.com/jherax/array-sort-by How to count […]
How to check TypeScript in project folders? Remember to exclude node_modules folders by configuring Could not find a declaration file for module ‘third-party-library-name’. ‘third-party-library-name.js’ has […]
Algorithm How to replace text inside a string? How to merge 2 objects? How to update value of a specific field? How to remove duplicates […]
date-fns How to convert UTC time to EAST? How to convert time string to Date instance? How to convert string to plain Javascript time object […]
Setup Create NodeJS project Code template How to open Chrome app, not Chromium? Open Terminal/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome –remote-debugging-port=9222 –no-first-run –no-default-browser-check –user-data-dir=$(mktemp -d -t ‘chrome-remote_data_dir’) You […]
Copyright © 2024 | WordPress Theme by MH Themes