An unofficial client for RALLY.
This is a bouzuya/b-o-a example.
This is a bouzuya/vdom-rxjs-ssr fork.
$ npm install
$ npm run build
$ npm start
$ open http://localhost:3000/
actions/ ... `type AT = A<P>; type P = ...;`
maps/ ... `type f = (action$: O<A>, state$: O<PT>) => O<A>;`
handlers/ ... `type Handler = (action$: O<A>, options: any) => O<A>;`
inits/ ... `type init = (params: any) => Promise<PT>`
props/ ... `type p = (action$: O<A>, state: <PT>) => O<PT>;`
types/ ... `type PT = { ... };`
requests/ ... `type request = (params: any) => Promise<PT>;`
routes/ ... route config file
styles/ ... less files
views/ ... `type view = (state: PT, helpers: any) => V;`
app.ts ... `type app = (action$: O<A>, options: any) => O<A>;`
client.ts ... client entry point. configure handlers and run app.
server.ts ... server entry point. configure handlers and run app.
A: Action
O: Observable
PT: PropertyType
V: VTree
title: init -> load
participant Browser as B
participant Client as C
participant Server as S
B->S: http get
S->S: init state
S-->B: initial html & state
B->B: render html
B->C: run js (app)
C->C: load state
C->B: render to dom
title: click -> request -> render
participant Browser as B
participant Client as C
participant Server as S
B->C: click event
C->C: user action (click -> fetch)
C->S: fetch
S-->C: json
C->C: user action (res -> update)
C->B: render
These diagram were generated by js-sequence-diagram.
O<A> |
+------>|-------+
| | |
| | |
FW | | | AP
| | |
| | |
+-------|<------+
| O<A>
O : Observable
A : Action
AP : Application
FW : Framework