mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-08-03 15:21:46 +08:00
16 lines
326 B
TypeScript
16 lines
326 B
TypeScript
import { onUnmounted } from 'vue';
|
|
import { WeatherController } from '../weather';
|
|
|
|
let weatherId = 0;
|
|
|
|
export function useWeather(): [WeatherController] {
|
|
const weather = new WeatherController(`@weather-${weatherId}`);
|
|
weatherId++;
|
|
|
|
onUnmounted(() => {
|
|
weather.destroy();
|
|
});
|
|
|
|
return [weather];
|
|
}
|