Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Starfx – A modern approach to side-effect and state management in UI (bower.sh)
12 points by qudat on March 1, 2024 | hide | past | favorite | 5 comments



I'm glad I have the opportunity to reinforce the statements in this post. I can say without a doubt that starfx is an implementation that is as clean as it is powerful.

At Softwiz, we have important production modules, which aggregate real business data of significant volume, written with starfx. I have followed the library's development since its inception, as it naturally follows from saga-query, providing a logical and seamless progression.

Personally, I take great pleasure in writing code using "thunks," and I believe the technique challenges you to be more imaginative without being restrictive.

For instance we can centralize the logic into thunks or apis, from different sources like IPC, workers, UI or the store itself. This allows us to combine or derive everything in an elegant manner.

The familiarity comes, I think, from the database metaphor where we are used to work with tables views and queries and Starfx translates those concepts in JavaScript.

From here roots a philosophy of handling effects, following the natural thought process for when we are managing data flows.


Hey all!

I wanted to show-off something I've been working on for the better part of a year. At Aptible, we have been using starfx in production for a few months now with great success.

Some resources to learn more:

- Michigan TypeScript Talk: https://www.youtube.com/watch?si=Mok0J8Wp0Z-ahFrN&v=uRbqLGj_...

- MVP: https://codesandbox.io/p/sandbox/starfx-simplest-dgqc9v?file...

- Examples repo: https://github.com/neurosnap/starfx-examples

- Production example: https://github.com/aptible/app-ui

Happy to answer questions! Thanks for taking a look.


yes but what do I say to my colleagues when they realize they need to learn generators (it's a non-trivial hurdle for many people)


Hi! Charles has a great article about why it's better to use generators over async/await:

https://frontside.com/blog/2023-12-11-await-event-horizon/

There are real benefits to using generators over async/await so I would encourage everyone to learn more about them and their benefits.


> yes but what do I say to my colleagues when they realize they need to learn generators (it's a non-trivial hurdle for many people)

Just tell them that they already know them.

`yield*` is

- a superset of `await` so if you understand `await`, you understand `yield*`

- infinitely more powerful because it can handle any effect, not just Promise resolution.

- It's just javascript syntax that predates `await`




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: