Project

General

Profile

Hacking Workbench2 » History » Version 1

Peter Amstutz, 02/13/2019 06:52 PM

1 1 Peter Amstutz
h1. Hacking Workbench2
2
3
The application logically begin in @workbench2/src/index.tsx@ with a call to fetchConfig() and then (when the promise is fulfilled) the constructs the major pieces of the application architecture:
4
5
"services" interact with external resources.  These classes define methods for reading and writing to a backend.  Service types include a service for each the API server endpoint that workbench uses, WebDAV server, workbench2 configuration like vocabulary and file viewers, and preferences kept in the browser local store.
6
7
"store" is a "Redux":https://redux.js.org/ state container.  State is divided into a groups.  Each group defines a "reducer".  A reducer is a function that takes (current state, action) and "reduces" it to a new state.  At start, reducers are executed with an undefined state to get the initial starting state.  After that, state is updated by "dispatching" an action to the state container.
8
9
The "App" component is invoked to rebuild the page (the "virtual DOM") whenever anything changes.  ReactDOM merges the virtual DOM changes into the actual browser DOM.