News for hackers. Stuff that matters.
Re:Show HN: A Simple LocalStorage Hook in React by r0rshrk on Wednesday November 06, 2019 @08:24AM (#21462234)
It has been a fun journey implementing hooks in React. Let me know your thoughts on the code :)
Re:Show HN: A Simple LocalStorage Hook in React by ljoshua on Wednesday November 06, 2019 @11:14AM (#21463941)
Hey congrats! People will complain about the package being to small or trivial, but just keep on creating. We all start somewhere, and hooks are a fun thing to experiment with.

It's true that most folks probably would do their own implementation of this and the GPL license would be a non-starter for most projects, but if it suits your needs and you've learned something in the process, more power to you. :)

Re:Show HN: A Simple LocalStorage Hook in React by funemployed on Wednesday November 06, 2019 @11:18AM (#21463994)
browser compatibility/other edge case handling would be one decent reason to utilize a package for otherwise straightforward implementations. The MDN docs have a helpful walkthrough for feature detecting localStorage that would make a useful addition to your library. https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage...
Re:Show HN: A Simple LocalStorage Hook in React by r0rshrk on Wednesday November 06, 2019 @09:49PM (#21469949)
Ooh, thanks. Must have a look
Re:Show HN: A Simple LocalStorage Hook in React by modarts on Wednesday November 06, 2019 @10:02AM (#21463226)
“Journey” is a bit of a stretch here, no? :)

This is a few lines of pretty trivial code

Re:Show HN: A Simple LocalStorage Hook in React by dang on Wednesday November 06, 2019 @02:30PM (#21466148)
Can you please review the Show HN guidelines? I appreciate that you're not exactly flaming the OP here, but still, the idea is to respond more charitably to people's work. If you know more than others, find a constructive way to express that, such as by teaching them—and by extension, the rest of us—something related to what they've done so far.

https://news.ycombinator.com/showhn.html

https://news.ycombinator.com/newsguidelines.html

Re:Show HN: A Simple LocalStorage Hook in React by modarts on Saturday November 09, 2019 @12:40AM (#21489851)
This is a great point, and on a second reading my comment did come off as a little insensitive -- will leave it up to give others context and make this a teachable moment for all of us to improve the level of discourse :)
Re:Show HN: A Simple LocalStorage Hook in React by TomMarius on Wednesday November 06, 2019 @10:12AM (#21463316)
Maybe he meant more hooks, in general. For me that is true, hooks really are a very inspirational pattern
Re:Show HN: A Simple LocalStorage Hook in React by wolco on Wednesday November 06, 2019 @10:32AM (#21463489)
Getting the tooling up and running took awhile.
Re:Show HN: A Simple LocalStorage Hook in React by buildawesome on Wednesday November 06, 2019 @11:35AM (#21464174)
Must've been pretty hard to type `npx create-react-app my-app`
Re:Show HN: A Simple LocalStorage Hook in React by dang on Wednesday November 06, 2019 @02:29PM (#21466129)
Please don't be a jerk on HN, regardless of how correct you are or feel you are.

https://news.ycombinator.com/newsguidelines.html

Re:Show HN: A Simple LocalStorage Hook in React by buildawesome on Thursday November 07, 2019 @05:26PM (#21477971)
Sorry Dang and Wolco.