1,746 karma · joined April 27, 2016
function useMagicNumber(default) {
const [magicNumber, setMagicNumber] = useState(default)
return [magicNumber, setMagicNumber]
}
And the following two components that use said hook: function ExampleA({}) => {
const [magicNumber, setMagicNumber] = useMagicNumber(1)
console.log(magicNumber) // 1
}
function ExampleB({}) => {
const [magicNumber, setMagicNumber] = useMagicNumber(2)
console.log(magicNumber) // 2
}
ExampleA and ExampleB share the same code that's run in the hook useMagicNumber, but the state reflected is unique to the component.Public intellectuals are attempting to appeal to the public at large, the majority of which don't change their minds based on new information. They change their minds based on how that information makes them feel. Trying to convince most people to change their minds with a complex argument is a lot like trying to convince most people to change their minds by talking in Italian instead of English.
That's just my idea, though. Hopefully, the current sad state of the web and the coming browser monoculture will spur others to experiment too. I know some gaming companies have experimented with the distributing and executing of x64 binary executables using the browser. I know others are looking into ways to chop up and do progressive loading on binary executables.
If you recall, I said...
> Hooks are great because it keeps the state local, but it can be re-used across components if we need to.
The use case you just defined is exactly why hooks were created.
This only works in small apps. I work on a medium sized app at work and we started that way too. It becomes a huge, sloppy mess in short order. Putting everything in Redux is akin to a desktop application that uses nothing but global state. Hooks are great because it keeps the state local, but it can be re-used across components if we need to.
Without any evidence to support it. It's one of those phrases that gets repeated without critical thought.
And if it didn't come to a grinding halt? They risk demonstrating how worthless their jobs are.
Since at least 2007. I'm sure we all remember the warm reception the Dropbox Show HN[0] got?
Bread has sugar in it. If you want bread without sugar in it, you must either pay more for the organic stuff or make it yourself. If you want bread without any additives or preservatives at all, you must buy your wheat from outside the country. Wheat in the US is fortified with iron and vitamin B by law.
Where can I read more about that? My google searches have not been fruitful.
There's a reason enrichment of foods is illegal in most of Europe.
My niece, which is the same age as two of the nephews, is far more into her dolls than video games. Although, she does like the occasional game of mario kart or kirby and the rainbow curse.
Ikea doesn't sell that chair anymore and apple doesn't sell that laptop anymore. sigh
But, if you want to run marathons or triathlons, google "alex viada the Hybrid Athlete." He's a bodybuilder who maintains his muscle mass and strength while also doing triathlons. He has a background in biochemistry and works in pharmaceuticals. At least he used to. I'm not sure if he still does.