mirror of
https://github.com/aljazceru/rabbit.git
synced 2025-12-17 14:04:21 +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';
|
import { createStore } from 'solid-js/store';
|
||||||
|
|
||||||
export type Stats = {
|
export type Stats = {
|
||||||
@@ -10,9 +12,11 @@ const [stats, setStats] = createStore<Stats>({
|
|||||||
activeBatchSubscriptions: 0,
|
activeBatchSubscriptions: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
setInterval(() => {
|
createRoot(() => {
|
||||||
console.debug('stats', { ...stats });
|
createEffect(() => {
|
||||||
}, 1000);
|
console.debug('stats', { ...stats });
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
const useStats = () => {
|
const useStats = () => {
|
||||||
const setActiveSubscriptions = (count: number) => setStats('activeSubscriptions', count);
|
const setActiveSubscriptions = (count: number) => setStats('activeSubscriptions', count);
|
||||||
|
|||||||
Reference in New Issue
Block a user