frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

'Vampire Squid from Hell' Reveals the Ancient Origins of Octopuses

https://www.sciencealert.com/vampire-squid-from-hell-reveals-the-ancient-origins-of-octopuses
1•6LLvveMx2koXfwn•49s ago•0 comments

I Built an Automated AI News SaaS – and Yes, You Can Clone the Whole Thing

https://ainewshub2025.netlify.app/
1•dhren•58s ago•1 comments

Airbus faces new quality problem on A320 jets, sources say

https://www.reuters.com/business/aerospace-defense/airbus-faces-new-quality-problem-dozens-a320-j...
1•belter•1m ago•0 comments

Around The World, Part 27: Planting trees

https://frozenfractal.com/blog/2025/11/28/around-the-world-27-planting-trees/
1•todsacerdoti•4m ago•0 comments

The Profit Behind Woke

https://substack.com/home/post/p-178888847
3•pjb88•6m ago•0 comments

Ask HN: Does anybody want LLMs run code in their developer environments?

1•yash_vaddi•6m ago•0 comments

Has the AI Bubble Popped Yet?

https://hastheaibubblepoppedyet.com/
2•bandamo•9m ago•1 comments

1GB Raspberry Pi 5, and memory-driven price rises

https://www.raspberrypi.com/news/1gb-raspberry-pi-5-now-available-at-45-and-memory-driven-price-r...
6•shrx•10m ago•0 comments

UK Government plans new powers to label dissenting movements as 'subversion'

https://netpol.org/2025/11/28/government-plans-new-powers-to-label-dissenting-movements-as-subver...
11•robtherobber•12m ago•0 comments

Doctype – '80s BASIC type-in mags are back, but this time for HTML

https://vole.wtf/doctype/
2•OuterVale•14m ago•0 comments

Self-hosting a Matrix server for 5 years

https://yaky.dev/2025-11-30-self-hosting-matrix/
15•the-anarchist•21m ago•1 comments

Have We Been Explaining E = Hν Backwards for 100 Years?

https://pajuhaan.medium.com/have-we-been-explaining-e-hν-backwards-for-100-years-bd140fec78a9
1•pajuhaan•23m ago•1 comments

How Toxic Culture Costs Companies Time, Talent, and Money and How to Fix It?

https://formrecipe.com/blog/how-toxic-culture-costs-companies-time-talent-money
1•deffrin•27m ago•0 comments

Rooted Resistance: Rashid Johnson's Potted Plants as Living Symbols

https://worldsensorium.com/rooted-resistance-rashid-johnsons-potted-plants-as-living-symbols/
1•dnetesn•28m ago•0 comments

How to Print a Human

https://nautil.us/how-to-print-a-human-1250487/
2•dnetesn•29m ago•0 comments

Supreme Court to Hear Copyright Battle over Online Music Piracy

https://www.nytimes.com/2025/12/01/us/politics/supreme-court-copyright-music-piracy.html
4•pseudolus•29m ago•1 comments

React-State-Custom – Composable global state with native lifecycle management

https://github.com/vothanhdat/react-state-custom
1•datvo•31m ago•1 comments

3D-printable concrete alternative hardens in three days, not four weeks

https://newatlas.com/materials/3d-printable-concrete-alternative/
1•wjSgoWPm5bWAhXB•35m ago•0 comments

A unified geometric model of structural space

https://zenodo.org/records/17687286
1•flexionU•35m ago•0 comments

DeepSeek-v3.2

https://huggingface.co/deepseek-ai/DeepSeek-V3.2
13•meetpateltech•36m ago•0 comments

Ilya Sutskever – We're moving from the age of scaling to the age of research [video]

https://www.youtube.com/watch?v=aR20FWCCjAs
3•bhaktatejas922•39m ago•0 comments

New semiconductor could allow classical and quantum computing on the same chip

https://www.livescience.com/technology/computing/new-semiconductor-could-allow-classical-and-quan...
1•donutloop•39m ago•0 comments

Google Quantum AI realizes three dynamic surface code implementations

https://phys.org/news/2025-11-google-quantum-ai-dynamic-surface.html
1•donutloop•41m ago•0 comments

What Is a City Super App and Why Every City Needs One

https://mertbulan.com/2025/12/01/what-is-a-city-super-app-and-why-every-city-needs-one/
1•mertbio•48m ago•0 comments

Not Just Gaza. From West Bank to Syria and Lebanon, Israel's Onslaught Continues

https://www.theguardian.com/commentisfree/2025/dec/01/gaza-west-bank-syria-lebanon-israel-ceasefire
10•hebelehubele•49m ago•0 comments

Modularization of Supercritical CO2 System for Aircraft Carrier Nuclear Power

https://www.mdpi.com/1099-4300/27/11/1154
1•PaulHoule•50m ago•0 comments

Content-Security-Policy Trust Erosion Scanner

https://github.com/Splinters-io/ghosted
1•splintersio•50m ago•1 comments

AI Hype TRAcking Project

https://poritz.net/jonathan/aitrap/index.html
2•runningmike•51m ago•0 comments

Xlibre is a fork of the Xorg Xserver with lots of code cleanups

https://x11libre.net/
21•doener•56m ago•13 comments

Why Is ChatGPT for Mac So Good?

https://allenpike.com/2025/why-is-chatgpt-so-good-claude
4•ingve•56m ago•0 comments
Open in hackernews

React-State-Custom – Composable global state with native lifecycle management

https://github.com/vothanhdat/react-state-custom
1•datvo•31m ago

Comments

datvo•31m ago
Hello HN,

I built react-state-custom because I found myself constantly choosing between two evils in React: "Provider Hell" (Context API) or "Immortal State" (Zustand/Redux, where state stays in memory forever unless manually reset).

I wanted a middle ground: The simplicity of a Custom Hook, but lifted to a global scope, with built-in garbage collection.

The core idea: You write a standard React hook, and the library wraps it into a global store that mounts/unmounts automatically based on usage.

How it works (The new API): ```typescript

import { useState } from 'react';

import { createStore } from 'react-state-custom';

// 1. Write a normal hook

const useCounterLogic = (initial = 0) => { const [count, setCount] = useState(initial); return { count, inc: () => setCount(c => c + 1) }; };

// 2. Turn it into a Global Store

// The '5000' is a grace period (ms) for auto-cleanup

export const { useStore: useGlobalCounter } = createStore('counter', useCounterLogic, { timeout: 5000 });

// 3. Use it anywhere (No Providers needed)

function Button() { const { count, inc } = useGlobalCounter(10); return <button onClick={inc}>{count}</button>; }

```

Key Features: * Lifecycle Management: Stores auto-unmount when no components are using them (after a configurable grace period). Great for caching UI state without memory leaks. * True Composability: Since stores are just hooks, you can call one store inside another to create reactive dependency graphs naturally. * Parameterized: You can pass props to your global store (useStore({ id: 1 })) to create distinct instances on the fly.

Repo: https://github.com/vothanhdat/react-state-custom Demo: https://vothanhdat.github.io/react-state-custom/

I'd love to hear your feedback on this approach!