mirror of
https://github.com/aljazceru/rabbit.git
synced 2025-12-17 05:54:19 +01:00
fix: print stats if updated
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { createEffect, createRoot } from 'solid-js';
|
||||
|
||||
import { createStore } from 'solid-js/store';
|
||||
|
||||
export type Stats = {
|
||||
@@ -10,9 +12,11 @@ const [stats, setStats] = createStore<Stats>({
|
||||
activeBatchSubscriptions: 0,
|
||||
});
|
||||
|
||||
setInterval(() => {
|
||||
createRoot(() => {
|
||||
createEffect(() => {
|
||||
console.debug('stats', { ...stats });
|
||||
}, 1000);
|
||||
});
|
||||
});
|
||||
|
||||
const useStats = () => {
|
||||
const setActiveSubscriptions = (count: number) => setStats('activeSubscriptions', count);
|
||||
|
||||
Reference in New Issue
Block a user