摘要:
Source: https://javascriptpatterns.vercel.app/patterns/performance-patterns/browser-hints Prefetch The `prefetch` browser hint can be used to fetch re 阅读全文
摘要:
Source: https://javascriptpatterns.vercel.app/patterns/performance-patterns/route-based-splitting If you're using react-router for navigation, you can 阅读全文
摘要:
Source: https://javascriptpatterns.vercel.app/patterns/performance-patterns/import-on-visibility One way to dynamically import components on interacti 阅读全文
摘要:
Source : https://javascriptpatterns.vercel.app/patterns/react-patterns/compound-pattern A compound compoennt usage looks like this: import React from 阅读全文
摘要:
Docs The name “SWR” is derived from stale-while-revalidate, a HTTP cache invalidation strategy popularized by HTTP RFC 5861. SWR is a strategy to firs 阅读全文
摘要:
Source: https://javascriptpatterns.vercel.app/patterns/design-patterns/prototype-pattern If you use factory pattern to create object: const createDog 阅读全文
摘要:
In JavaScript, the factory pattern isn't much more than a function that returns an object without using the new keyword. ES6 arrow functions allow us 阅读全文
摘要:
Source: https://javascriptpatterns.vercel.app/patterns/design-patterns/singleton-pattern With the Singleton Pattern, we restrict the instantiation of 阅读全文
摘要:
Module pattern provide a way to have both public and private pieces with the export keyword. This protects values from leaking into the global scope o 阅读全文