Skip to content

Accessing data type-safe in script tag #11

Closed Answered by ottomated
juztim asked this question in Q&A
Discussion options

You must be logged in to vote

You would use something like a derived store.

const data = trpc.example.query();

const filtered = derived(data, (d) => {
  if (!d.isSuccess) return;
  return d.filter(/* something */);
});

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@juztim
Comment options

@ottomated
Comment options

@juztim
Comment options

@ottomated
Comment options

@ottomated
Comment options

Answer selected by juztim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants