mirror of
https://github.com/motajs/template.git
synced 2026-04-12 15:11:10 +08:00
14 lines
349 B
TypeScript
14 lines
349 B
TypeScript
import { onUnmounted } from 'vue';
|
|
import { WeatherController } from '../weather';
|
|
import { IRenderTreeRoot } from '@motajs/render';
|
|
|
|
export function useWeather(renderer: IRenderTreeRoot): [WeatherController] {
|
|
const weather = new WeatherController(renderer);
|
|
|
|
onUnmounted(() => {
|
|
weather.destroy();
|
|
});
|
|
|
|
return [weather];
|
|
}
|