[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-docs] branch master updated: anastasis reducer
From: |
gnunet |
Subject: |
[taler-docs] branch master updated: anastasis reducer |
Date: |
Fri, 23 Oct 2020 19:50:47 +0200 |
This is an automated email from the git hooks/post-receive script.
dennis-neufeld pushed a commit to branch master
in repository docs.
The following commit(s) were added to refs/heads/master by this push:
new 9da4ba3 anastasis reducer
9da4ba3 is described below
commit 9da4ba3b74d5725160831cce8ec94e5e2f47daf7
Author: Dennis Neufeld <dennis.neufeld@students.bfh.ch>
AuthorDate: Fri Oct 23 19:50:33 2020 +0200
anastasis reducer
---
anastasis.rst | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 69 insertions(+)
diff --git a/anastasis.rst b/anastasis.rst
index 355d0d7..f7232c5 100644
--- a/anastasis.rst
+++ b/anastasis.rst
@@ -815,10 +815,79 @@ Anastasis Reducer API
This section describes the Anastasis Reducer API which is used by client
applications
to store or load the different states the client application can have.
+The reducer takes a state_ in JSON syntax and returns the new state in JSON
syntax.
+
+For example a **state** may take the following structure:
+::
+
+ {
+ "backup_state": "CONTINENT_SELECTING",
+ "continents": [
+ "Europe",
+ "North_America"
+ ]
+ }
+
+The new state depends on the previous one and on the transition action_ with
its
+arguments given to the reducer. A **transition argument** also is a statement
in JSON syntax:
+::
+
+ {
+ "continent": "Europe"
+ }
+
+The new state returned by the reducer with the state and transition argument
defined
+above would look like following for the transition action_ "select_continent":
+::
+
+ {
+ "backup_state": "COUNTRY_SELECTING",
+ "continents": [
+ "Europe",
+ "North_America"
+ ],
+ "selected_continent": "Europe",
+ "countries": [
+ {
+ "code": "ch",
+ "name": "Switzerland",
+ "continent": "Europe",
+ "name_i18n": {
+ "de_DE": "Schweiz",
+ "de_CH": "Schwiiz",
+ "fr": "Suisse",
+ "en": "Swiss"
+ },
+ "currency": "CHF"
+ },
+ {
+ "code": "de",
+ "name": "Germany",
+ "continent": "Europe",
+ "continent_i18n": {
+ "de": "Europa"
+ },
+ "name_i18n": {
+ "de_DE": "Deutschland",
+ "de_CH": "Deutschland",
+ "fr": "Allemagne",
+ "en": "Germany"
+ },
+ "currency": "EUR"
+ }
+ ]
+ }
+
+**State**:
+ - In SELECTING-States the user has to choose one value out of a predefined
set of values (for example a continent out of a set of continents).
+ - In COLLECTING-States the user has to give certain values.
+ - In EDITING-States the user is free to choose which values he wants to give.
Backup Reducer
^^^^^^^^^^^^^^
+.. _state:
+.. _action:
.. figure:: anastasis_reducer_backup.png
:name: fig-anastasis_reducer_backup
:alt: fig-anastasis_reducer_backup
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-docs] branch master updated: anastasis reducer,
gnunet <=