Better way to go from DependDict to JSON then TouchOut?

Is there a better way than the Examine dat to convert a DependDict to json then send it out through touchOut?

What I have seems to work but it feels hacky.

Additionally, I’m not sure how the dependency is actually tracking here with the use of .getRaw() but it is working for some reason.:thinking:

Previously I was manually calling TDJ.jsonToDat(self.State.getRaw(), <textDatRef>) in my extension when an update happened. This has the downside of having to do some equally hacky stuff to get state changes to properly send when multiple updates come in really close to each other. Old code is on github if you’re curious.

I’d really like to just have a DependDict in my extension and let touch manage change subscription if possible as it makes things much simpler.

I ended up scrapping the TDJSON / DependDict all together and switching to udpOut.send() instead which ended up being much simpler.

If anyone does stumble across this though and knows a good way to subscribe to a dependency in this way I am still curious if its possible.

I think you pretty much got the method here. You could use an evaluateDAT too, I guess.

1 Like