Integrated Dynamics - On the Dynamics of Integration

Transient Storage

Since Integrated Dynamics is based on functional programming principles, keeping track of states is mainly non-existent, except through external approaches such as the Delayer.

As the JavaScript language offers a mix of both functional and imperative programming, keeping track of states becomes partially possible.

Concretely, if you declare a mutable variable outside of functions (for example using let), you can modify its values through function invocations.

This way, you can keep track of states, such as counting the number of function calls, or calculating the running average of specific values.

An important catch to these variables is that their state is only transient. Concretely, this means that their values can be reset any time a variable card in the network is re-inserted, or when the server restarted.

As such, you can not assume these values to always remain present. If you need persistent data storage, it is better to make use of the Delayer.

let state = 0;
function getAndIncr(value) {
  return state += value;
}
let sum = 0;
let amount = 0;
function getRunningAvg(value) {
  amount++;
  sum += value;
  return sum / amount;
}