Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pgx as reactiveValue #128

Merged
merged 2 commits into from
Apr 22, 2022
Merged

Pgx as reactiveValue #128

merged 2 commits into from
Apr 22, 2022

Conversation

ivokwee
Copy link
Member

@ivokwee ivokwee commented Apr 22, 2022

To pass the active pgx object around, currently a handle to a reactive function that is actually created inside the loaiding module, is passed using an "envitonment" list, passed into the modules and env[['load']][['inputData']]. This handle is used inside the modules often referred (and dereferenced) as ngs <- inputData() or pgx <- inputData, and after that ngs/pgx are used to access the object. I now created a reactiveValues object in the main server part, which is a "list to reactiveValues" from the active pgx objects. Instead of the construct above, the modules can directly access the reactiveValues object referring it as pgx, so without having to do pgx <- inputData(). The major advantage is that the pgx object is also writable, so we can make modifications in the object even in the modules (have to be careful though!). Please have a look in the server.R right after the loading module, and the code changes in board.dataview. The 'env' list object and 'pgx' reactiveValues will remain both existing in the transition, later we can get rid of the 'env' object I think.

@ivokwee
Copy link
Member Author

ivokwee commented Apr 22, 2022

See comment above. I also converted the main module to the new style moduleServer. See again board.dataview.

@stefanreifenberg stefanreifenberg merged commit 83f71f5 into develop Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants