A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.npmjs.com/package/@orpc/vue-colada below:

@orpc/vue-colada - npm

@orpc/vue-colada1.8.1 • Public • Published 4 days ago

Typesafe APIs Made Simple 🪄

oRPC is a powerful combination of RPC and OpenAPI, makes it easy to build APIs that are end-to-end type-safe and adhere to OpenAPI standards

You can find the full documentation here.

Integration with Pinia Colada. Read the documentation for more information.

export function Setup() {
  const query = useQuery(orpc.planet.find.queryOptions({
    input: { id: 123 }, // Specify input if needed
    context: { cache: true }, // Provide client context if needed
  // additional options...
  }))

  const mutation = useMutation(orpc.planet.create.mutationOptions({
    context: { cache: true }, // Provide client context if needed
  // additional options...
  }))

  mutation.mutate({ name: 'Earth' })

  const queryCache = useQueryCache()

  // Invalidate all planet queries
  queryCache.invalidateQueries({
    key: orpc.planet.key(),
  })

  // Invalidate the planet find query with id 123
  queryCache.invalidateQueries({
    key: orpc.planet.find.key({ input: { id: 123 } })
  })
}

Distributed under the MIT License. See LICENSE for more information.

Share feedback
Package Sidebar Install Downloads Weekly Downloads Collaborators

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4