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

Retrieving nodes from config #1528

Closed
Mr-Kanister opened this issue Jan 6, 2025 · 4 comments
Closed

Retrieving nodes from config #1528

Mr-Kanister opened this issue Jan 6, 2025 · 4 comments
Labels

Comments

@Mr-Kanister
Copy link

Describe your problem

Is it necessary to delete the nodes of the virtual-tour-plugin config object here?

I'd like to retrieve all nodes after the viewer has been loaded and don't want to use another fetch request to parse them if somehow possible.

Online demo URL

No response

Photo Sphere Viewer version

5.11.4

Plugins loaded

Virtual-Tour

Additional context

No response

@mistic100
Copy link
Owner

I always try to cleanup data I dont use anymore.

What don't you make a copy yourself ?

You can also access virtualTourPlugin.datasource.nodes if needed.

@Mr-Kanister
Copy link
Author

I understand. I must say however, that this behaviour is quite unintuitive, at least for me. The config property is public and of Type VirtualTourPluginConfig with no sign of manual removal of the nodes.

The copy is of course doable, however, it is sometimes a bit annoying to “pass through” the copy to any function in need.

The datasource property is private, so I'd rather not use that in TS...

@mistic100
Copy link
Owner

Sorry I don't really understand the problem. The config property is already a copy of your initial config, yes it is public, but it is still internal to the plugin.

You should remain owner of the data you need, so keep the original config object in your app.

@Mr-Kanister
Copy link
Author

Valid view, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants