HackerLangs
TopNewTrendsCommentsPastAskShowJobs

halflife

434 karmajoined 6 năm trước

Submissions

Show HN: React-logic – DI and signals – write react without hooks

roypeled.github.io
1 points·by halflife·2 tháng trước·0 comments

Ytmnd

en.wikipedia.org
3 points·by halflife·8 tháng trước·0 comments

Do not accept terms and conditions

termsandconditions.game
97 points·by halflife·9 tháng trước·71 comments

TypeScript type level base 10 to binary transformation

gist.github.com
1 points·by halflife·10 tháng trước·0 comments

comments

halflife
·Hôm kia·discuss
Makes sense, thanks!
halflife
·Hôm kia·discuss
Thanks for the detailed comment! I always heard that bees pollinate the vast majority of plants, so in the parent comment, I assumed incorrectly that the meaning was for bees in general being non native.
halflife
·Hôm kia·discuss
If they are not native, how did plant propagate seeds? Flies? Wasps? Butterflies?
halflife
·12 ngày trước·discuss
I actually find this incredible, since this highlights how desperate they are to advertise these glasses
halflife
·14 ngày trước·discuss
Jest mocks allow developers to write bad code. Instead of separating concerns with DI, jest mocks overwrite the importing mechanism without any type safety. Also, if you wish to migrate to native node test runner, the mocks lock you into jest.

Use proper mocks with ts mockito and it will force you to write better code.
halflife
·tháng trước·discuss
If you need to protect your border inside, than you already failed. Borders are protected outside the country.
halflife
·tháng trước·discuss
Israel has clearly defined borders. If youre are talking about the West Bank there’s area a, b and c which are controlled by Israel, both, and PA respectively. I’d call that borders.
halflife
·tháng trước·discuss
[flagged]
halflife
·tháng trước·discuss
When all you need is a synchronous operations, yes. When it involves async, batching, buffering, and user input, it becomes much more complicated, and every step needs to be setup manually.
halflife
·tháng trước·discuss
Agreed, the OP said that the r in rxjs stands for reactivity, so my point was the the names have little bearing on the actual design patterns achieved with the libs
halflife
·tháng trước·discuss
A derived state is certainly reactive.
halflife
·tháng trước·discuss
Maybe push pull wasn’t the best metaphor, but the point is that everything can be reactive, it only depends on how much boilerplate you need to write to achieve the desired result.

Since react doesn’t have a true reactive model, you need to subscribe to changes manually (use effect) to create computations, while in signals it’s a primitive (computed).

I actually created a lib that operates signals over reacts state management (https://roypeled.github.io/react-logic/), so I removed the boilerplate to create a true reactive system.

If you want, you can create reactive system just from JS primitives, using callbacks. But that doesn’t make JS reactive by nature.
halflife
·tháng trước·discuss
Its entire state management is not reactive, it’s always on push, not pull. You always need to call setState to get render changes.
halflife
·tháng trước·discuss
The react in react stands for reactivity, however it is not.
halflife
·tháng trước·discuss
I partially agree, there is an overlap between signals and rxjs, however the core business is different- observables are about data manipulation, while signals are about efficient state management.

Regarding angular I agree, rxjs was a bad choice for data management, and before signals arrived I abandoned rxjs in favor of mobx in my angular projects. However you could roll your own http client, we used axios, and using DI it’s a drop in replacement.
halflife
·tháng trước·discuss
Each one of these solves a different problem.

Promised - async

Observables - streams

Signals - reactivity
halflife
·tháng trước·discuss
I think Trent reznor did a fantastic job with the soundtrack, maybe the only person that could’ve fit in daft punks shoes
halflife
·tháng trước·discuss
Don’t like to cast stones, but this feels like Claude trying whatever it can to make things work, without fixing the underlying process and problem.

“It looks like the user wants to run curl on windows machine, I need to bootstrap Linux under docker, and channel bash commands into shell inside docker, so the user would be able to run curl natively.”
halflife
·tháng trước·discuss
Reading the blog I thought I was probably missing something. Reading the comments I learn that I missed nothing. Weird blog post.
halflife
·2 tháng trước·discuss
I’ve never said blacks. That’s your own bias creeping into my explanation.

And it really doesn’t matter why some countries got poorer, this is the fact right now so my point still stands.