h3llo
h3llo
TtRPC
Created by h3llo on 12/26/2024 in #❓-help
subscription tracked returns a 3-tuple to frontend instead of object
The current workaround to make both runtime and ts happy is to use yield* tracked instead of yield tracked, which returns TrackedId | someObject and then handle each case
if (typeof event === 'object') {
console.log('From onData callback, object data', event);
} else {
console.log('From onData callback, trackedId', event);
}
if (typeof event === 'object') {
console.log('From onData callback, object data', event);
} else {
console.log('From onData callback, trackedId', event);
}
but this is not optimal...
3 replies