SAHTI

SAHTI Contact information, map and directions, contact form, opening hours, services, ratings, photos, videos and announcements from SAHTI, Health & Wellness Website, Casablanca.

๐Ÿš€ Optimize Your Event Listeners with AbortController!Handling event listeners properly can make a huge difference in app...
20/03/2025

๐Ÿš€ Optimize Your Event Listeners with AbortController!

Handling event listeners properly can make a huge difference in app performance. Instead of manually removing them, let AbortController do the work for you!

๐Ÿ”ฅ Why You Should Use AbortController:
๐Ÿšซ No more memory leaks โ€“ Listeners are automatically cleaned up.
โšก Improved performance โ€“ Reduces unnecessary operations.
๐Ÿ›  Cleaner code โ€“ No need for multiple removeEventListener calls.

โš–๏ธ The Comparison:
โŒ Traditional Approach (Manual Cleanup)
โ€ข Manually attach and remove event listeners.
โ€ข Can be error-prone if you forget cleanup.

โœ… Modern Approach (AbortController)
โ€ข Listeners are registered with { signal }, allowing easy abort.
โ€ข Just call ac.abort() to remove all listeners at once!

๐Ÿ”ฅ Follow Abdul Moqueet for React, Full Stack Development, and modern web trends!

๐Ÿš€ ๐‰๐š๐ฏ๐š๐’๐œ๐ซ๐ข๐ฉ๐ญ ๐€๐ซ๐ซ๐š๐ฒ ๐Œ๐ž๐ญ๐ก๐จ๐๐ฌ ๐„๐ฑ๐ฉ๐ฅ๐š๐ข๐ง๐ž๐ ๐•๐ข๐ฌ๐ฎ๐š๐ฅ๐ฅ๐ฒ! ๐ŸŽจUnderstanding JavaScript array methods can be tricky, but visualizing th...
19/03/2025

๐Ÿš€ ๐‰๐š๐ฏ๐š๐’๐œ๐ซ๐ข๐ฉ๐ญ ๐€๐ซ๐ซ๐š๐ฒ ๐Œ๐ž๐ญ๐ก๐จ๐๐ฌ ๐„๐ฑ๐ฉ๐ฅ๐š๐ข๐ง๐ž๐ ๐•๐ข๐ฌ๐ฎ๐š๐ฅ๐ฅ๐ฒ! ๐ŸŽจ

Understanding JavaScript array methods can be tricky, but visualizing them makes it easier! ๐Ÿง‘โ€๐Ÿ’ป

๐Ÿ“Œ ๐๐ฎ๐ข๐œ๐ค ๐๐ซ๐ž๐š๐ค๐๐จ๐ฐ๐ง:
๐Ÿ”น .map(โฌ› โ†’ โญ˜) โ†’ Transforms each element
๐Ÿ”น .filter(โฌ›) โ†’ Keeps only matching elements
๐Ÿ”น .find(โฌ›) โ†’ Finds the first matching element
๐Ÿ”น .findIndexOf(โฌ›) โ†’ Finds the index of the first match
๐Ÿ”น .fill(1, โญ˜) โ†’ Replaces elements starting at index 1
๐Ÿ”น .some(โฌ›) โ†’ Checks if any element matches
๐Ÿ”น .every(โฌ›) โ†’ Checks if all elements match

This is how JavaScript helps us efficiently manipulate arrays! ๐Ÿ’ก Have you used these methods in your projects? Let's discuss in the comments! ๐Ÿ‘‡

๐Ÿ’ป

How to load your websites at lightning speed?Check out these 8 tips to boost frontend performance:1 - CompressionCompres...
19/03/2025

How to load your websites at lightning speed?

Check out these 8 tips to boost frontend performance:

1 - Compression
Compress files and minimize data size before transmission to reduce network load.

2 - Selective Rendering/Windowing
Display only visible elements to optimize rendering performance. For example, in a dynamic list, only render visible items.

3 - Modular Architecture with Code Splitting
Split a bigger application bundle into multiple smaller bundles for efficient loading.

4 - Priority-Based Loading
Prioritize essential resources and visible (or above-the-fold) content for a better user experience.

5 - Pre-loading
Fetch resources in advance before they are requested to improve loading speed.

6 - Tree Shaking or Dead Code Removal
Optimize the final JS bundle by removing dead code that will never be used.

7 - Pre-fetching
Proactively fetch or cache resources that are likely to be needed soon.

8 - Dynamic Imports
Load code modules dynamically based on user actions to optimize the initial loading times.

Over to you: What other frontend performance tips would you add to this cheat sheet?

--
Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): https://bit.ly/bbg-social

29/01/2023

presentation of the Yass Codes ๐Ÿ–ฅ

Address

Casablanca

Website

Alerts

Be the first to know and let us send you an email when SAHTI posts news and promotions. Your email address will not be used for any other purpose, and you can unsubscribe at any time.

Share