repos / starfx

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

commit
31d72aa
parent
6d4b1b7
author
Eric Bower
date
2024-03-01 16:30:09 +0000 UTC
docs: copy
4 files changed,  +55, -49
M docs/main.go
+10, -3
 1@@ -24,9 +24,10 @@ func main() {
 2 				Page: pager("getting-started.md"),
 3 				Tag:  "Info",
 4 				Children: []*pdocs.Sitemap{
 5-					pdocs.AnchorTagSitemap("Design Philosophy"),
 6-					pdocs.AnchorTagSitemap("The Simplest Example"),
 7-					pdocs.AnchorTagSitemap("Effection"),
 8+					pdocs.AnchorTagSitemap("Motivation"),
 9+					pdocs.AnchorTagSitemap("When to use this library"),
10+					pdocs.AnchorTagSitemap("Code Example"),
11+					pdocs.AnchorTagSitemap("Install"),
12 				},
13 			},
14 			{
15@@ -157,6 +158,12 @@ func main() {
16 				Page: pager("testing.md"),
17 				Tag:  "Advanced",
18 			},
19+			{
20+				Text: "Design Philosophy",
21+				Href: "/design-philosophy",
22+				Page: pager("design-philosophy.md"),
23+				Tag:  "Info",
24+			},
25 			{
26 				Text: "API",
27 				Href: "/api",
A docs/posts/design-philosophy.md
+13, -0
 1@@ -0,0 +1,13 @@
 2+---
 3+title: Design Philosophy
 4+---
 5+
 6+- user interaction is a side-effect of using a web app
 7+- side-effect management is the central processing unit to manage user
 8+  interaction, app features, and state
 9+- leverage structured concurrency to manage side-effects
10+- leverage supervisor tasks to provide powerful design patterns
11+- side-effect and state management decoupled from the view
12+- user has full control over state management (opt-in to automatic data
13+  synchronization)
14+- state is just a side-effect (of user interaction and app features)
M docs/posts/getting-started.md
+25, -39
 1@@ -3,17 +3,20 @@ title: Getting Started
 2 description: Use starfx with deno, node, or the browser
 3 ---
 4 
 5-# design philosophy
 6-
 7-- user interaction is a side-effect of using a web app
 8-- side-effect management is the central processing unit to manage user
 9-  interaction, app features, and state
10-- leverage structured concurrency to manage side-effects
11-- leverage supervisor tasks to provide powerful design patterns
12-- side-effect and state management decoupled from the view
13-- user has full control over state management (opt-in to automatic data
14-  synchronization)
15-- state is just a side-effect (of user interaction and app features)
16+# motivation
17+
18+Are you frustrated by the following issues in your react app?
19+
20+- Prop drilling
21+- Waterfall fetching data
22+- Loading spinners everywhere
23+- Extraneous network calls
24+- Business logic tightly coupled to react component lifecycle hooks
25+- State management boilerplate
26+- Lack of data normalization
27+- Lack of async flow control tooling
28+
29+`starfx` will help with all of these common problems with modern react web apps.
30 
31 # when to use this library?
32 
33@@ -24,27 +27,7 @@ server that serves files and that's it.
34 Is your app highly interactive, requiring it to persist data across pages? This
35 is the sweet spot for `starfx`.
36 
37-You can use this library for general purpose structured concurrency, but
38-[effection](https://github.com/thefrontside/effection) serves those needs well.
39-
40-You could use this library for SSR, but I don't heavily build SSR apps, so I
41-cannot claim it'll work well.
42-
43-# install
44-
45-```bash
46-npm install starfx
47-```
48-
49-```bash
50-yarn add starfx
51-```
52-
53-```ts
54-import * as starfx from "https://deno.land/x/starfx@0.7.0/mod.ts";
55-```
56-
57-# the simplest example
58+# code
59 
60 Here we demonstrate a complete example so you can glimpse at how `starfx` works.
61 In this example, we will fetch users from an API endpoint, cache the `Response`
62@@ -105,13 +88,16 @@ ReactDOM.createRoot(root).render(
63 );
64 ```
65 
66-# `effection`
67+# install
68 
69-In order to support structured concurrency, we are using `effection` to manage
70-that for us. As a result, in order to be successful using `starfx` developers
71-need to understand how `effection` works.
72+```bash
73+npm install starfx
74+```
75 
76-We highly recommend reading through their docs at least once to get some
77-fundamental knowledge for how these libraries work together.
78+```bash
79+yarn add starfx
80+```
81 
82-[Read the `effection` docs](https://frontside.com/effection)
83+```ts
84+import * as starfx from "https://deno.land/x/starfx@0.7.0/mod.ts";
85+```
M docs/tmpl/home.page.tmpl
+7, -7
 1@@ -23,30 +23,30 @@
 2     <article class="features">
 3       <div class="box">
 4         <h3 class="m-0 p-0 text-lg">
 5-          Task tree side-effect system
 6+          Data synchronization and caching
 7         </h3>
 8-        <p>Leverage structured concurrency to express any async flow control logic</p>
 9+        <p>A powerful middleware system to fetch API data</p>
10       </div>
11 
12       <div class="box">
13         <h3 class="m-0 p-0 text-lg">
14           An immutable and reactive data store
15         </h3>
16-        <p>Redux meets zod for state management</p>
17+        <p>A normalized database for UI and API data</p>
18       </div>
19 
20       <div class="box">
21         <h3 class="m-0 p-0 text-lg">
22-          Data synchronization and caching
23+         React integration
24         </h3>
25-        <p>A powerful middleware system to handle all front-end business requirements</p>
26+        <p>Built for react</p>
27       </div>
28 
29       <div class="box">
30         <h3 class="m-0 p-0 text-lg">
31-         React integration
32+          Task tree side-effect system
33         </h3>
34-        <p>Designed with React in mind</p>
35+        <p>A robust system for handling complex business logic</p>
36       </div>
37     </article>
38   </div>