This file contains 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
pub struct RectIter { | |
points: Vec<(f64, f64)>, | |
idx: usize, | |
} | |
impl Iterator for RectIter { | |
type Item = (f64, f64); | |
/* | |
* The reason why is mutable (&mut self), is that the only way to iterate through something, |
ERR_PNPM_BAD_PM_VERSION This project is configured to use v9.1.1 of pnpm. Your current pnpm is v9.0.4
If you want to bypass this version check, you can set the "package-manager-strict" configuration to "false" or set the "COREPACK_ENABLE_STRICT" environment variable to "0"
This file contains 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
// @see https://play.vuejs.org/#eNqtV19zm0YQ/yoXpjNCEwmlap9UrHHruNNmpnamTtMHoQcMh0QCB4VDtkaj797dvTs4sCwnk/hFsLf7273982N9cH4tS2/XcGfh+HVUpaVkWSg2F4Ej68BhNZdNuQxEmpdFJdmBVTyZsIdQRlv9c50kPJITJvij/JBGnyesqflVXX8Mq5odWVIVORuBg1EgWpi3TZ7vfy+qXB97s1aCsYCqVryVW171FFtJX/EOfjPe0+xEWjUQUSFqyfJ6wy7wIu7oD55lBfu3qLL41WhsKcyNRlIU3UFUNELqkzcgNXLR5LUWC/7A7rh0xx1aWN505yvC8HZh1vC1BZHv/wpLCwPe/FpWqdhAapv8nler9dJdrUZhlo0mbPVmvV6jj0AkjYhkWgi2DUWc8asMiuCO2SEQTAWsnL1+jYLZjIJVIi+MY9dSAThmHUM05jYrz/O6g4mNi5c4YhxhvRcRG0QD1+gF9LL/nsaXh0CGlESNDZ3r6mTpCrROnmprP/BOfmwcLqAKvHbHyssgoyDqoQMQAdiyfqzK/XPO6Qz+TJ17QGCLZ6pt6ArhQ5hC++nRcyHLF8s20Wed0Pk5P6TQZvaID7rQwxIXMc8+op1L1gum+lZXHIapjYB+NQqRh4sVnTArbpyGIuNeVmzcEc1VBG42PMYpxCiMJd3teVM1T09s1bABQ1VvQxnqeSNrlC3YaDTBF56HaYZvxm5w539A+a65z1Ppop26as8/iiGvdErlMj7bZKBA5yIQ/kyRL1AtvEgO1BVKDm+M+dsfl4cDsdbx6M/gDTReTadQHjruyDTHSkwJH/gbDIDAL5syBqRF/2xYOVCcLdl0Sg6V0wokqs+6AOZdBCDuyHk3JfhFvre9zwn1FJqiZoa2HZxF4RoPYEzWXrhJVw/tkxDLSmWQMQj/3d3tjac6M032VDYERnbNsgmbj+FuZDVTZlQITLMJ3t/Ol0BEEPCcUAET+1Nb3TdSQntcRsh2bVzE |
This file contains 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
function Foo() { | |
const now = performance.now(); | |
/** | |
* The result of the first performance.now() call (stored in now) is subtracted from the current time. | |
* This effectively calculates the time elapsed since the loop began. | |
* | |
* the loop keeps running as long as it hasn't been a full second since the startTime was captured. | |
* Once the elapsed time hits or goes above 200ms, the loop condition becomes false, and the loop terminates. | |
*/ |
This file contains 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
useEffect(() => { | |
// componentDidMount ? | |
}, []); | |
useEffect(() => { | |
// componentDidUpdate ? | |
}, [foo, bar]); | |
useEffect(() => { | |
return () => { |
Debouncing is a technique used to ensure that a function doesn't get called too frequently.
It's commonly employed in scenarios where we want to wait for a pause in user input before triggering an action.
For example, in search bars, debounce delays the execution of the search function until the user has finished typing, preventing unnecessary API requests with each keystroke.
This file contains 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
describe('useQueryProductById', () => { | |
afterEach(() => { | |
jest.clearAllMocks(); | |
}); | |
it('should return a single product', async () => { | |
const product = { | |
id: 2, | |
title: 'Mens Casual Premium Slim Fit T-Shirts ', | |
price: 22.3, |
NewerOlder