Skip to content

Instantly share code, notes, and snippets.

import { useSyncExternalStore } from 'react'
/**
* This will call the given callback function whenever the contents of the map
* change.
*/
class ObservableMap extends Map {
constructor(entries) {
super(entries)
this.listeners = new Set()
@bronifty
bronifty / README.md
Created October 14, 2023 20:46 — forked from tannerlinsley/README.md
Replacing Create React App with the Next.js CLI

Replacing Create React App with the Next.js CLI

How dare you make a jab at Create React App!?

Firstly, Create React App is good. But it's a very rigid CLI, primarily designed for projects that require very little to no configuration. This makes it great for beginners and simple projects but unfortunately, this means that it's pretty non-extensible. Despite the involvement from big names and a ton of great devs, it has left me wanting a much better developer experience with a lot more polish when it comes to hot reloading, babel configuration, webpack configuration, etc. It's definitely simple and good, but not amazing.

Now, compare that experience to Next.js which for starters has a much larger team behind it provided by a world-class company (Vercel) who are all financially dedicated to making it the best DX you could imagine to build any React application. Next.js is the 💣-diggity. It has amazing docs, great support, can grow with your requirements into SSR or static site generation, etc.

So why

@bronifty
bronifty / index.ts
Created August 5, 2023 00:01 — forked from trvswgnr/SyncService.test.ts
daxxer challenge 2
class SyncService {
private processing = false;
constructor(
private bService: IBService,
private monitorService: IMonitorService,
private logService: ILogService,
private userCache: ICacheService<UserId>,
private idempotencyKeys: ICacheService<EventId>,
private queue: IQueueService<EventFromA>,