Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
refactor: rename location query
Browse files Browse the repository at this point in the history
  • Loading branch information
saeidex committed Nov 5, 2024
1 parent be45518 commit 0ac6732
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions apps/next/src/app/dashboard/buses/[busId]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { MqttProvider, useMqttSubscription } from "@ubus/mqtt";
import { MqttProvider, useBusLocationQuery } from "@ubus/mqtt";

interface BusLocationPageProps {
params: {
Expand All @@ -17,7 +17,7 @@ const BusLocationPage = (props: BusLocationPageProps) => {
};

const BusLocationContent = (props: BusLocationPageProps) => {
const { data: location, error } = useMqttSubscription(props.params.busId);
const { data: location, error } = useBusLocationQuery(props.params.busId);

// if (isLoading) return <p>Loading...</p>;
if (error)
Expand Down
2 changes: 1 addition & 1 deletion packages/mqtt/src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useQuery } from "@tanstack/react-query";
import { mqttClient as client } from "./client";
import { getBusLocationTopic } from "./topics";

export const useMqttSubscription = (busId: string) => {
export const useBusLocationQuery = (busId: string) => {
const topic = getBusLocationTopic(busId);

return useQuery({
Expand Down

0 comments on commit 0ac6732

Please sign in to comment.