repos / starfx

supercharged async flow control library.
git clone https://github.com/neurosnap/starfx.git

commit
a3fa13b
parent
7bed2b5
author
Eric Bower
date
2024-03-05 14:29:12 +0000 UTC
docs: copy
1 files changed,  +20, -14
M docs/posts/getting-started.md
+20, -14
 1@@ -5,19 +5,18 @@ description: Use starfx with deno, node, or the browser
 2 
 3 # motivation
 4 
 5-We think you need a react framework or server-side rendering because that's
 6-where money is being made. If we are building a highly dynamic and interactive
 7-web application then we probably don't need SSR. These frameworks sell us that
 8-they are an easier way to build web apps, but that's not true. Just think of it
 9-this way: if we can build a web app using only static assets, isn't that simpler
10-than having static assets and a react framework server?
11+We think we need a react framework and server-side rendering (SSR) because
12+that's where money is being made. If we are building a highly dynamic and
13+interactive web application then we probably don't need SSR. These frameworks
14+sell us that they are an easier way to build web apps, but that's not true. Just
15+think of it this way: if we can build a web app using only static assets, isn't
16+that simpler than having static assets **and** a react framework server?
17 
18 React hook-based fetching and caching libraries dramatically simplify data
19 synchronization but are so tightly coupled to a component's life cycle that it
20 creates waterfall fetches and loading spinners everywhere. We also have the
21 downside of not being able to normalize our cache which means we have to spend
22-time thinking about how and when to invalidate our various caches that hold the
23-identical API entities.
24+time thinking about how and when to invalidate our various caches.
25 
26 Further, all of these data caching libraries don't handle data normalization. In
27 every library we are going to see a line similar to this: "Data normalization is
28@@ -57,19 +56,26 @@ The benefits of using this library:
29 
30 # when to use this library?
31 
32-The primary target for this library are single-page apps. This is for an app
33-that might be hosted inside an object store (like s3) or with a simple web
34-server that serves files and that's it.
35+The primary target for this library are SPAs. This is for an app that might be
36+hosted inside an object store (like s3) or with a simple web server (like nginx)
37+that serves files and that's it.
38 
39 Is your app highly interactive, requiring it to persist data across pages? This
40 is the sweet spot for `starfx`.
41 
42+This library is **not** a great fit for ecommerce, tiny projects, or blogs. This
43+is for web apps that are generally behind a login screen that require a
44+desktop-class user experience. This library is designed to scale, so it might
45+feel a little overwhelming. Just know if you use this library, your code will be
46+easier to read, easier to write, all while handling a massive amount of business
47+complexity.
48+
49 # code
50 
51 Here we demonstrate a complete example so you can glimpse at how `starfx` works.
52-In this example, we will fetch users from an API endpoint, cache the `Response`
53-json, and then ensure the endpoint only gets called at-most once every **5
54-minutes**, mimicking the basic features of `react-query`.
55+In this example, we will fetch a github repo from an API endpoint, cache the
56+`Response` json, and then ensure the endpoint only gets called at-most once
57+every **5 minutes**, mimicking the basic features of `react-query`.
58 
59 [Codesanbox](https://codesandbox.io/p/sandbox/starfx-simplest-dgqc9v?file=%2Fsrc%2Findex.tsx)
60