You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a call that looks like ray().toJson(jsonValue).color(componentColor).label(componentName) that gets called fairly often while on a page. The problem is that the snippet of code will initiate 3 requests to the ray server instead of 1. This causes some sort of race condition which means that the label or color may not apply to the initial payload. It does seem to work about 80% of the time, but when I am issuing this call quickly back to back for different components, it will likely fail.
The solution I have implemented is to tap into the sending_payload_callback setting and attach a new ColorPayload and a LabelPayload to the initial payload. As far as I can tell this works, but it is a painful work around. Perhaps there could be a new method called chain() which would allow me to do something like ray().chain( (ray) => ray.toJson(jsonValue).color(componentColor).label(componentName) ).
Another issue was that the Payload objects were not exported, so I couldn't import them inside vite. I ended up copying the code from the esm module to create the Payload classes.
The text was updated successfully, but these errors were encountered:
I have a call that looks like
ray().toJson(jsonValue).color(componentColor).label(componentName)
that gets called fairly often while on a page. The problem is that the snippet of code will initiate 3 requests to the ray server instead of 1. This causes some sort of race condition which means that the label or color may not apply to the initial payload. It does seem to work about 80% of the time, but when I am issuing this call quickly back to back for different components, it will likely fail.The solution I have implemented is to tap into the
sending_payload_callback
setting and attach a new ColorPayload and a LabelPayload to the initial payload. As far as I can tell this works, but it is a painful work around. Perhaps there could be a new method calledchain()
which would allow me to do something likeray().chain( (ray) => ray.toJson(jsonValue).color(componentColor).label(componentName) )
.Another issue was that the Payload objects were not exported, so I couldn't import them inside vite. I ended up copying the code from the esm module to create the Payload classes.
The text was updated successfully, but these errors were encountered: