Now we will add a summary table on top of our dynamic data table. This summary table should be updated according to the assets selected (note the plural since we allow for the All case in this tab). Take a moment to try to think how you would implement this yourself? If you tried to replicate the pattern shown previously for the data object we showed before, you would have a correct but inefficient solution. The reason is that the logic to filter the data would be duplicated, which is unnecessary.
To avoid this pitfall we show next how to share streams among different reactive functions using the reactive() function, which is a function that used to prepare reactive values for other reactive functions. In this case, we move all the logic we had created before into the expression sent as a parameter to this function and assign it to the data...