frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: Tired of logic in useEffect, I built a class-based React state manager

https://thales.me/posts/why-i-built-snapstate/
6•thalesfp•1h ago

Comments

mjfisher•48m ago
Just to sanity-check my reading of this:

- Zustand exposes itself as a hook.

- MobX does that observer-wrapper thing

- Snapstate instead has an explicit writing step (`scoped()`) at the bottom of a component

If so, I really quite like that. Kudos!

igor47•46m ago
All the examples are fetching data from a server, and in such cases I think tanstack query already does all the hard part. I feel like people under-use react query and put too much state in their FE. This might be relevant if your app has some really complicated interactions, but for most apps they should really be a function of server, not client, state. Of course this exact reasoning is why I moved off react altogether and now use htmx in most of my projects
hungryhobbit•14m ago
Javascript and classes go together like toothpaste and orange juice. All good JS programmers I know essentially pretend that classes don't exist in the language (or if they use them, they only do so rarely, for very niche cases).

JS does not have classical OOP built in! It has Brandon Eich's prototypal inheritance system (which has some key differences), along with a 2015 addition to the language to pretend it has OOP (but really that's just lipstick on the underlying prototypal pig).

If you use classes in JS, you're bound to be disappointed at some point when they don't behave like classical OOP. Most devs accept that and use more functional approaches (like factory functions) instead of OOP.

epgui•2m ago
For clarity, what do you call "classical OOP"?

(disclaimer: FP all the way, regardless)

jemmyw•12m ago
We have a similar style of react state manager that we use at Aha! https://github.com/aha-app/mvc

I think the intent is very similar even though there are some structural differences: move the state and state logic out of the view to classes.

Fabrica: Autonomous Engineering Plugin for OpenClaw

https://github.com/MestreY0d4-Uninter/fabrica
1•MestreY0d4•47s ago•1 comments

The Political Disaster That Is California [video][15min]

https://www.youtube.com/watch?v=inOci0iH4Q8
1•Bender•1m ago•0 comments

Amazon Stopping Support for Old Kindles

https://www.independent.co.uk/news/world/americas/amazon-kindle-ending-support-old-e-readers-b295...
1•oj2828•4m ago•2 comments

Show HN: Prefab – A generative UI framework for Python

https://prefab.prefect.io/docs/welcome
2•jlowin•4m ago•0 comments

Local SEO Analyst Agent – PDF Report Generation

https://github.com/jeffjbowie/Local-SEO-Analyst-Agent
1•Veritaco•6m ago•0 comments

Are We in the Chinese Room?

https://thefriendlyghost.nl/chinese-room-ai/
1•cvanelteren•10m ago•0 comments

The Hormuz chokehold affects AI funding too

https://highabsolutevalue.substack.com/p/the-hormuz-chokehold-affects-ai-funding
2•preetnation•10m ago•0 comments

I Don't Care What the Haters Are Saying, I'm Having a Blast

https://systemdrift.neocities.org/blog/i-dont-care-what-the-haters-are-saying-im-having-a-blast
1•myrrhman•10m ago•0 comments

Waymo's Robot Car Testing Ends in NYC After Permits Expire

https://www.thecity.nyc/2026/04/06/waymo-driverless-cars-testing-roads-autonomous-vehicle/
2•xnx•12m ago•0 comments

Digital Assets Rules Need Clarity

https://www.wsj.com/opinion/digital-assets-rules-need-clarity-6dfcab70
1•petethomas•16m ago•0 comments

U.S. Made a Deal That Gives Us Nothing We Wanted

https://www.theatlantic.com/national-security/2026/04/iran-strait-hormuz-us-trump-nuclear-weapons...
3•JumpCrisscross•17m ago•0 comments

WireGuard VPN developer's Microsoft account locked

https://twitter.com/EdgeSecurity/status/2041872931576299888
2•worik•17m ago•2 comments

I built a canvas where AI agents work together as a design team

https://designagents.app/blog/what-if-your-design-team-was-made-of-ai-agents
1•aliparnan•18m ago•0 comments

All You Need Is Not All You Need

https://www.researchsquare.com/article/rs-8399522/v1
1•cfcfcf•18m ago•0 comments

I built an agent agnostic, locally run, open-source observability product

https://github.com/Metabuilder-Labs/openclawwatch
2•anil-metabldr•20m ago•0 comments

Wells Fargo whistleblower award slashed by Wall Street watchdog

https://www.ft.com/content/b18fff7e-0797-4dba-bec6-4f8843cffd13
1•petethomas•21m ago•0 comments

I built CLI tool that analyzes logs and explains incidents

https://github.com/sydes-ai/ai-autopsy
1•naiks1214•23m ago•1 comments

Show HN: Portable AI memoryswitch providers, keep your context

https://github.com/mahadillahm4di-cyber/mh-gdpr-ai.eu-s-plus
2•mahadillah-ai•23m ago•0 comments

Peer-to-Peer Republic

https://republic.p2plabs.xyz/
1•akhileshthite•25m ago•0 comments

Every company is now a media company–and every boss a star

https://economist.com/business/2026/04/08/every-company-is-now-a-media-company-and-every-boss-a-star
2•andsoitis•29m ago•0 comments

Childhood Mortality by Parental Cause of Death

https://jamanetwork.com/journals/jamanetworkopen/fullarticle/2846843
2•PaulHoule•32m ago•0 comments

Can We Measure Software Slop? An Experiment

https://pscanf.com/s/352/
1•j03b•33m ago•0 comments

The genetics of GLP-1 drugs

https://www.nature.com/articles/s41586-026-10330-z
2•jackdaw12•36m ago•0 comments

Show HN: Clipper – The World's Fastest Container Registry

https://clipper.dev
1•a_t48•37m ago•0 comments

Mama pig and her piglet going outside for the first time after being rescued

https://old.reddit.com/r/nextfuckinglevel/comments/1se9sh6/mama_pig_and_her_piglet_going_outside_...
1•oxqbldpxo•40m ago•0 comments

Coz: Causal profiling that measures optimization potential

https://github.com/plasma-umass/coz
1•embedding-shape•43m ago•0 comments

What Are AI Tokens and Context Limits? Why Your AI Forgets What You Told It

https://theaienabledcoder.com/ai-tools/what-are-ai-tokens-and-context-limits/
1•mooreds•43m ago•0 comments

Source: An app to prove your photos aren't AI

https://www.openorigins.com/products/secure-source
4•vladivstok•43m ago•2 comments

Career-Ops – multi agent job search

https://github.com/santifer/career-ops
2•mehmetkose•44m ago•0 comments

Enjoy Open Source Free Tailwind Component Library – 1,700 Component

https://opentailwind.dev/
1•babacklindo•44m ago•0 comments