HNHacker News
TopNewBestAskShowJobs

nihakue

117 karma · joined September 30, 2014

[ my public key: https://keybase.io/kiddo; my proof: https://keybase.io/kiddo/sigs/lFvIH5mlGo46KdI_HLaS4ad3MJqm0YiMhh-bFXtFKaA ]
submissionscomments
nihakue··on Why Do React Hooks Rely on Call Order?
Re: 'Flaw #6: We Still Need a Linter' (first example):

Could the 'primitive' hooks (useState, useEffect, etc) walk up `arguments.callee.caller.arguments.callee.caller...` grabbing function names until you hit a React function? Then use the names to create a 'composed' key automatically? It still doesn't solve the problem of a function using the same hook twice in one function, but it might solve the problem of collision across custom hooks.

Example:

    function useCount() {
      const [count, setState] = useState(0)
      return { count, increment: () => setState(count + 1)};
    }

    function useCountPlusOne() {
      const {count: baseCount, increment} = useCount()
      return {count: baseCount + 1, increment}
    }

    function MyHookComponent() {
      const { count, increment } = useCountPlusOne()
      return ...
    }

Would give you a key of `useState(useCount(useCountPlusOne(MyHookComponent)))` without the end user having to futz around composing the key manually. At this point you could probably even forego the 'use*' convention

It's still pretty magical, but the magic seems more abstracted. In general I've really liked hooks, and I'm willing to put up with the wackiness (although testing them with enzyme is a big PITA right now).

Thanks for the article :)

nihakue··on FilmFish: Humanly curated movie recommendations
Looks great, also have some feedback:

Some of your trailer and video provider links aren't matching the film described, rather films with similar titles. See the following examples:

The link to watch "The Lobster" on Amazon Prime takes me to "My Village, My Lobster", a documentary about lobster fishermen in Nicaragua[1]

The link to view the trailer for the indie sci-fi film "The Wall" pulls up a trailer for "Roger Waters The Wall", another documentary, this time about Pink Floyd, possibly.[2]

[1]: http://www.amazon.com/My-Village-Lobster-Bil-Yoelin/dp/B00C5...

[2]: https://www.youtube.com/watch?v=ZuPyeCX7Fgg

nihakue··on Autonomous Plant Watering
The Wifi outlet seems like mega overkill to run a schedule. Couldn't you just use one of these? https://www.google.co.uk/search?q=socket+timer+us&safe=off&b...
nihakue··on Tone: An experimental Chrome extension for instant sharing over audio
I think it's worth mentioning that this is yet another fairly cool project that relies on an always-on* microphone. I don't remember who said it, but there was a very nice quote on HN recently about the currency of freedom i.e. it's not something you should never spend, but you should be certain you're getting your money's worth. :I

*I realize you can turn it on and off, but it's not designed to be done easily.

nihakue··on Reverse OCR
That is totally cool. It feels like watching an oil painter slowly work from something very abstract (layers of brushstrokes) to something very recognizable (a human face).
← PreviousPage 2 of 2