repos / starfx

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

commit
5ad5b08
parent
dc8227a
author
Eric Bower
date
2024-06-10 18:42:58 +0000 UTC
chore: nav
3 files changed,  +87, -41
M docs/main.go
+67, -41
  1@@ -30,37 +30,78 @@ func main() {
  2 				},
  3 			},
  4 			{
  5-				Text: "Thunks",
  6-				Href: "/thunks",
  7-				Page: pager("thunks.md"),
  8+				Text: "Controllers",
  9 				Children: []*pdocs.Sitemap{
 10-					pdocs.AnchorTagSitemap("Thunk Action"),
 11-					pdocs.AnchorTagSitemap("Thunk Payload"),
 12-					pdocs.AnchorTagSitemap("Custom ctx"),
 13+					{
 14+						Text: "Overview",
 15+						Href: "/controllers",
 16+						Page: pager("controllers.md"),
 17+					},
 18+					{
 19+						Text: "Thunks",
 20+						Href: "/thunks",
 21+						Page: pager("thunks.md"),
 22+						Children: []*pdocs.Sitemap{
 23+							pdocs.AnchorTagSitemap("Thunk Action"),
 24+							pdocs.AnchorTagSitemap("Thunk Payload"),
 25+							pdocs.AnchorTagSitemap("Custom ctx"),
 26+						},
 27+					},
 28+					{
 29+						Text: "Endpoints",
 30+						Href: "/endpoints",
 31+						Page: pager("endpoints.md"),
 32+						Children: []*pdocs.Sitemap{
 33+							pdocs.AnchorTagSitemap("Enforcing fetch response type"),
 34+							pdocs.AnchorTagSitemap("The same API endpoints but different logic"),
 35+							pdocs.AnchorTagSitemap("Using variables inside the API endpoint"),
 36+							pdocs.AnchorTagSitemap("ctx.request"),
 37+							pdocs.AnchorTagSitemap("Using ctx.req"),
 38+							pdocs.AnchorTagSitemap("ctx.response"),
 39+							pdocs.AnchorTagSitemap("ctx.json"),
 40+							pdocs.AnchorTagSitemap("Middleware automation"),
 41+						},
 42+					},
 43 				},
 44 			},
 45 			{
 46-				Text: "Endpoints",
 47-				Href: "/endpoints",
 48-				Page: pager("endpoints.md"),
 49+				Text: "Models",
 50 				Children: []*pdocs.Sitemap{
 51-					pdocs.AnchorTagSitemap("Enforcing fetch response type"),
 52-					pdocs.AnchorTagSitemap("The same API endpoints but different logic"),
 53-					pdocs.AnchorTagSitemap("Using variables inside the API endpoint"),
 54-					pdocs.AnchorTagSitemap("ctx.request"),
 55-					pdocs.AnchorTagSitemap("Using ctx.req"),
 56-					pdocs.AnchorTagSitemap("ctx.response"),
 57-					pdocs.AnchorTagSitemap("ctx.json"),
 58-					pdocs.AnchorTagSitemap("Middleware automation"),
 59-				},
 60-			},
 61-			{
 62-				Text: "Store",
 63-				Href: "/store",
 64-				Page: pager("store.md"),
 65-				Children: []*pdocs.Sitemap{
 66-					pdocs.AnchorTagSitemap("How to update state"),
 67-					pdocs.AnchorTagSitemap("Updating state from view"),
 68+					{
 69+
 70+						Text: "Overview",
 71+						Href: "/models",
 72+						Page: pager("models.md"),
 73+						Children: []*pdocs.Sitemap{
 74+							pdocs.AnchorTagSitemap("How to update state"),
 75+							pdocs.AnchorTagSitemap("Updating state from view"),
 76+						},
 77+					},
 78+					{
 79+
 80+						Text: "Store",
 81+						Href: "/store",
 82+						Page: pager("store.md"),
 83+						Children: []*pdocs.Sitemap{
 84+							pdocs.AnchorTagSitemap("How to update state"),
 85+							pdocs.AnchorTagSitemap("Updating state from view"),
 86+						},
 87+					},
 88+					{
 89+						Text: "Schema",
 90+						Href: "/schema",
 91+						Page: pager("schema.md"),
 92+						Children: []*pdocs.Sitemap{
 93+							pdocs.AnchorTagSitemap("Schema Assumptions"),
 94+							pdocs.AnchorTagSitemap("any"),
 95+							pdocs.AnchorTagSitemap("str"),
 96+							pdocs.AnchorTagSitemap("num"),
 97+							pdocs.AnchorTagSitemap("obj"),
 98+							pdocs.AnchorTagSitemap("table"),
 99+							pdocs.AnchorTagSitemap("loader"),
100+							pdocs.AnchorTagSitemap("Build your own slice"),
101+						},
102+					},
103 				},
104 			},
105 			{
106@@ -76,21 +117,6 @@ func main() {
107 					pdocs.AnchorTagSitemap("useLoaderSuccess"),
108 				},
109 			},
110-			{
111-				Text: "Schema",
112-				Href: "/schema",
113-				Page: pager("schema.md"),
114-				Children: []*pdocs.Sitemap{
115-					pdocs.AnchorTagSitemap("Schema Assumptions"),
116-					pdocs.AnchorTagSitemap("any"),
117-					pdocs.AnchorTagSitemap("str"),
118-					pdocs.AnchorTagSitemap("num"),
119-					pdocs.AnchorTagSitemap("obj"),
120-					pdocs.AnchorTagSitemap("table"),
121-					pdocs.AnchorTagSitemap("loader"),
122-					pdocs.AnchorTagSitemap("Build your own slice"),
123-				},
124-			},
125 			{
126 				Text: "Caching",
127 				Href: "/caching",
A docs/posts/controllers.md
+12, -0
 1@@ -0,0 +1,12 @@
 2+---
 3+title: Controllers
 4+description: How controllers work in starfx
 5+---
 6+
 7+Why do we call this a micro-mvc framework? Well, our controllers are lighter
 8+weight than traditional MVC frameworks.
 9+
10+Controllers do not relate to pages, they most often relate to centralized pieces
11+of business logic. This could be as simple as making a single API endpoint and
12+caching the results or as complex as making multiple dependent API calls and
13+combinatory logic.
A docs/posts/models.md
+8, -0
1@@ -0,0 +1,8 @@
2+---
3+title: Models
4+description: State management in starfx
5+---
6+
7+Since data normalization is a first-class citizen inside `starfx` we custom
8+built a react database for your front-end web apps. Our store is most similar to
9+`redux` but with a couple of important differences.