Skip to content

Putting not serializable objects to state #583

Closed Answered by jourdain
kerim371 asked this question in General
Discussion options

You must be logged in to vote

So the main purpose of server.state is to share data with the front-end (browser). Therefore it does not make much sense to put something in it that you don't want to send over the network.

Technically you could use server.context (API) which is a server side only state which aim for you to leverage its reactive nature. Or put global things to it.

But in your use case, it seems that you only want to keep track of methods so you can easily call them anywhere. Well in that case, you can use the server.controller to bind methods to, so you can call them later when ever you need. In all our example that is what we do for keeping track of reset_camera and update. (example)

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by kerim371
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants