diff --git a/.github/workflows/gh-pages-deploy.yml b/.github/workflows/gh-pages-deploy.yml
deleted file mode 100644
index f9d90f6..0000000
--- a/.github/workflows/gh-pages-deploy.yml
+++ /dev/null
@@ -1,42 +0,0 @@
-name: Deploy static content to Pages
-
-on:
- workflow_dispatch:
-
-concurrency:
- group: 'pages'
- cancel-in-progress: true
-
-permissions:
- contents: read
- pages: write
- id-token: write
-
-jobs:
- deploy:
- environment:
- name: github-pages
- url: ${{ steps.deployment.outputs.page_url }}
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v4
- - name: Enable Corepack
- run: corepack enable
- - name: Set up Node
- uses: actions/setup-node@v4
- with:
- node-version: 22.13.0
- - name: Install dependencies
- run: yarn install
- - name: Build
- run: yarn build
- - name: Setup Pages
- uses: actions/configure-pages@v4
- - name: Upload artifact
- uses: actions/upload-pages-artifact@v3
- with:
- path: './dist'
- - name: Deploy to GitHub Pages
- id: deployment
- uses: actions/deploy-pages@v4
diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml
new file mode 100644
index 0000000..9f3da02
--- /dev/null
+++ b/.github/workflows/playwright.yml
@@ -0,0 +1,24 @@
+name: Playwright Tests
+on:
+ workflow_dispatch:
+jobs:
+ test:
+ timeout-minutes: 60
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: lts/*
+ - name: Install dependencies
+ run: npm ci
+ - name: Install Playwright Browsers
+ run: npx playwright install --with-deps
+ - name: Run Playwright tests
+ run: npx playwright test
+ - uses: actions/upload-artifact@v4
+ if: ${{ !cancelled() }}
+ with:
+ name: playwright-report
+ path: playwright-report/
+ retention-days: 30
diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml
index a20f8f5..4cda5ae 100644
--- a/.github/workflows/pr-check.yml
+++ b/.github/workflows/pr-check.yml
@@ -22,16 +22,16 @@ jobs:
node-version: 22.13.0
- name: Install dependencies
- run: yarn install
+ run: npm install
- name: Run linter
- run: yarn lint
+ run: npm run lint
- name: Run type check
- run: yarn typecheck
+ run: npm run typecheck
- name: Run unit tests
- run: yarn test
+ run: npm run test
- name: Run build
- run: yarn build
+ run: npm run build
diff --git a/.gitignore b/.gitignore
index b31f822..a5fc7b1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,35 +1,36 @@
-# Logs
-logs
-*.log
+# dependencies
+/node_modules
+
+# testing
+/coverage
+
+# next.js
+/.next/
+/out/
+
+# production
+/build
+
+# misc
+.DS_Store
+*.pem
+
+# debug
npm-debug.log*
-yarn-debug.log*
-yarn-error.log*
-pnpm-debug.log*
-lerna-debug.log*
-
-node_modules
-dist
-dist-ssr
-*.local
-
-# Editor directories and files
-.vscode/*
-!.vscode/extensions.json
+
+# env files (can opt-in for committing if needed)
+.env*
+
+# vercel
+.vercel
+
+# typescript
+*.tsbuildinfo
+next-env.d.ts
+
+#IDEs
.idea
-.DS_Store
-*.suo
-*.ntvs*
-*.njsproj
-*.sln
-*.sw?
-
-.pnp.*
-.yarn/*
-!.yarn/patches
-!.yarn/plugins
-!.yarn/releases
-!.yarn/sdks
-!.yarn/versions
+.vscode
# Playwright
/test-results/
@@ -39,3 +40,5 @@ dist-ssr
# Jest
/coverage
+
+
diff --git a/.husky/commit-msg b/.husky/commit-msg
index 2785bc1..dbce4f4 100644
--- a/.husky/commit-msg
+++ b/.husky/commit-msg
@@ -1 +1 @@
-yarn commitlint --edit $1
+commitlint --edit $1
diff --git a/.husky/pre-commit b/.husky/pre-commit
index 017e2a1..1335dcd 100644
--- a/.husky/pre-commit
+++ b/.husky/pre-commit
@@ -1 +1 @@
-yarn lint-staged --allow-empty
+lint-staged --allow-empty
diff --git a/.lintstagedrc.mjs b/.lintstagedrc.mjs
index bac0c8d..3d6baf0 100644
--- a/.lintstagedrc.mjs
+++ b/.lintstagedrc.mjs
@@ -1,9 +1,9 @@
export default {
'*.{js,jsx,ts,tsx}': [
- 'yarn prettier --write',
- 'yarn eslint --fix',
- 'yarn test',
- () => 'yarn typecheck',
+ 'prettier --write',
+ 'eslint --fix',
+ 'jest --passWithNoTests',
+ () => 'npm run typecheck',
],
- '*.{json,css,scss,md}': ['yarn prettier --write', 'yarn eslint --fix'],
+ '*.{json,css,scss,md}': ['prettier --write', 'eslint --fix'],
};
diff --git a/README.md b/README.md
index d4da1ee..d7317de 100644
--- a/README.md
+++ b/README.md
@@ -43,9 +43,9 @@ git clone git@github.com:vault-developer/event-loop-explorer.git
cd event-loop-explorer
-yarn install
+npm install
-yarn dev
+npm run dev
```
### Future Plans:
diff --git a/app/(main)/header/header.tsx b/app/(main)/header/header.tsx
new file mode 100644
index 0000000..3c39714
--- /dev/null
+++ b/app/(main)/header/header.tsx
@@ -0,0 +1,27 @@
+import { ThemeToggle } from './themeToggle';
+import { Repeat, Github } from 'lucide-react';
+import { Button } from '@/components/chadcdn/button';
+import Link from 'next/link';
+
+export function Header() {
+ return (
+
+
+
+
Event loop explorer
+
+
+
+
+
+
+
+
+
+
+
+ );
+}
diff --git a/app/(main)/header/themeToggle.tsx b/app/(main)/header/themeToggle.tsx
new file mode 100644
index 0000000..ed517dc
--- /dev/null
+++ b/app/(main)/header/themeToggle.tsx
@@ -0,0 +1,22 @@
+import { useTheme } from 'next-themes';
+import { Button } from '@/components/chadcdn/button';
+import { Moon, Sun } from 'lucide-react';
+
+export function ThemeToggle() {
+ const { setTheme, theme } = useTheme();
+ const onToggle = () => setTheme(theme === 'light' ? 'dark' : 'light');
+
+ return (
+
+
+
+ Toggle theme
+
+ );
+}
diff --git a/app/(main)/page.tsx b/app/(main)/page.tsx
new file mode 100644
index 0000000..74b87b9
--- /dev/null
+++ b/app/(main)/page.tsx
@@ -0,0 +1,51 @@
+'use client';
+
+import { Header } from './header/header';
+import { Configurator } from '@/app/(main)/sections/configurator/configurator';
+import { WebApi } from '@/app/(main)/sections/webApi';
+import { RequestAnimationFrame } from '@/app/(main)/sections/requestAnimaitionFrame';
+import { Callstack } from '@/app/(main)/sections/callstack';
+import { Console } from '@/app/(main)/sections/console';
+import { TasksQueue } from '@/app/(main)/sections/tasksQueue';
+import { MicrotasksQueue } from '@/app/(main)/sections/microtasksQueue';
+import { EventLoop } from '@/app/(main)/sections/eventLoop/eventLoop';
+
+export default function Home() {
+ return (
+
+ );
+}
diff --git a/app/(main)/sections/callstack.tsx b/app/(main)/sections/callstack.tsx
new file mode 100644
index 0000000..238b0fd
--- /dev/null
+++ b/app/(main)/sections/callstack.tsx
@@ -0,0 +1,39 @@
+import { FC } from 'react';
+import { InfoContainer } from '@/components/infoContainer';
+import { List } from '@/components/list';
+import { Card } from '@/components/card';
+import { useQueueManagerStore } from '@/store/store';
+
+const description = (
+ <>
+
+ A call stack is a mechanism for an interpreter to keep track of its place
+ in a script that calls multiple functions — what function is currently
+ being run and what functions are called from within that function, etc.
+
+
+ When a script calls a function, the interpreter adds it to the call stack
+ and then starts carrying out the function.
+
+
+ When the current function is finished, the interpreter takes it off the
+ stack and resumes execution where it left off in the last code listing.
+
+
+ If the stack takes up more space than it was assigned, a "stack
+ overflow" error is thrown.
+
+ >
+);
+
+export const Callstack: FC = () => {
+ const stack = useQueueManagerStore((state) => state.callstack);
+
+ return (
+
+
+ {(el) => }
+
+
+ );
+};
diff --git a/app/(main)/sections/configurator/configurator.tsx b/app/(main)/sections/configurator/configurator.tsx
new file mode 100644
index 0000000..340f6ff
--- /dev/null
+++ b/app/(main)/sections/configurator/configurator.tsx
@@ -0,0 +1,42 @@
+import { FC, useState } from 'react';
+import { InfoContainer } from '@/components/infoContainer';
+import { Controls } from './controls';
+import { Editor } from './editor';
+import {
+ DEFAULT_EXAMPLE_KEY,
+ EXAMPLES,
+} from '@/app/(main)/sections/configurator/controls.data';
+
+const description = (
+ <>
+
+ This code editor allows you to write and visualize JavaScript code
+ execution within the event loop.
+
+
+
+ - select a pre-built example from the dropdown menu or write your own
+ code from scratch.
+
+
+ - use the speed scrollbar to control the execution speed and observe how
+ the event loop processes your code.
+
+
+ - pause the execution when needed to examine the state of the event loop
+ at any given point.
+
+
+ >
+);
+
+export const Configurator: FC = () => {
+ const [code, setCode] = useState(() => EXAMPLES[DEFAULT_EXAMPLE_KEY].code);
+
+ return (
+
+
+
+
+ );
+};
diff --git a/src/pages/home/sections/Configurator/Configurator.data.tsx b/app/(main)/sections/configurator/controls.data.tsx
similarity index 81%
rename from src/pages/home/sections/Configurator/Configurator.data.tsx
rename to app/(main)/sections/configurator/controls.data.tsx
index e8a1376..e8e5ff5 100644
--- a/src/pages/home/sections/Configurator/Configurator.data.tsx
+++ b/app/(main)/sections/configurator/controls.data.tsx
@@ -1,17 +1,22 @@
-export const codeExamples = [
- {
+interface Example {
+ title: string;
+ code: string;
+}
+
+export const EXAMPLES: Record = {
+ synchronous: {
title: 'synchronous',
code: `console.log(1);
console.log(2);
console.log(3);`,
},
- {
+ tasksQueue: {
title: 'tasks queue',
code: `console.log(1);
setTimeout(()=>console.log(2), 0);
console.log(3);`,
},
- {
+ callstack: {
title: 'callstack',
code: `function foo1() {
console.log(1);
@@ -27,7 +32,7 @@ function foo3() {
}
foo1();`,
},
- {
+ microtasks: {
title: 'microtasks',
code: `console.log(1);
setTimeout(() => console.log(2), 0);
@@ -38,7 +43,7 @@ Promise.resolve().then(() => {
setTimeout(() => console.log(5), 500);
console.log(6);`,
},
- {
+ requestAnimationFrame: {
title: 'requestAnimationFrame',
code: `console.log(1);
queueMicrotask(() => console.log(2));
@@ -46,7 +51,7 @@ requestAnimationFrame(() => console.log(3));
requestAnimationFrame(() => console.log(4));
console.log(5);`,
},
- {
+ everything: {
title: 'everything',
code: `function foo1() {
console.log('foo1');
@@ -76,4 +81,7 @@ console.log('global');
setTimeout(() => console.log('global:1'), 500);
foo1();`,
},
-];
+};
+
+export const EXAMPLES_KEYS = Object.keys(EXAMPLES);
+export const DEFAULT_EXAMPLE_KEY = EXAMPLES_KEYS[0];
diff --git a/app/(main)/sections/configurator/controls.tsx b/app/(main)/sections/configurator/controls.tsx
new file mode 100644
index 0000000..fa7fab0
--- /dev/null
+++ b/app/(main)/sections/configurator/controls.tsx
@@ -0,0 +1,72 @@
+import { FC } from 'react';
+import { ControlsUi } from './controls.ui';
+import {
+ useControlsStore,
+ useEditorStore,
+ useQueueManagerStore,
+ useWheelStore,
+} from '@/store/store';
+import { EXAMPLES } from '@/app/(main)/sections/configurator/controls.data';
+import { getSimulationSteps } from '@/utils/getSimulationSteps/getSimulationSteps';
+import { simulate } from '@/utils/simulate/simulate';
+
+interface ControlsProps {
+ code: string;
+ setCode: (key: string) => void;
+}
+
+export const Controls: FC = ({ setCode, code }) => {
+ const {
+ status,
+ setStatus,
+ speed,
+ setSpeed,
+ clear: clearControls,
+ } = useControlsStore();
+ const clearWheel = useWheelStore((state) => state.clear);
+ const clearQueueManager = useQueueManagerStore((state) => state.clear);
+ const setEditorSource = useEditorStore((state) => state.setSource);
+
+ const serialisedSpeed = Math.log2(speed);
+
+ const onClear = () => {
+ clearQueueManager();
+ clearControls();
+ clearWheel();
+ };
+ const onSerialisedSpeedChange = (value: number[]) =>
+ setSpeed(Math.pow(2, value[0]));
+ const onPlay = () => {
+ onClear();
+ const steps = getSimulationSteps(code);
+ setEditorSource(code);
+ setStatus('running');
+ simulate(steps, onFinish);
+ window.scrollTo({
+ top: document.body.scrollHeight,
+ behavior: 'smooth',
+ });
+ };
+ const onResume = () => setStatus('running');
+ const onPause = () => setStatus('paused');
+ const onFinish = () => setStatus('idle');
+ const onStop = () => {
+ onFinish();
+ onClear();
+ };
+ const onExampleSelect = (key: string) => setCode(EXAMPLES[key].code);
+
+ return (
+
+ );
+};
diff --git a/app/(main)/sections/configurator/controls.ui.tsx b/app/(main)/sections/configurator/controls.ui.tsx
new file mode 100644
index 0000000..0d8cf51
--- /dev/null
+++ b/app/(main)/sections/configurator/controls.ui.tsx
@@ -0,0 +1,141 @@
+import { FC } from 'react';
+import {
+ Select,
+ SelectContent,
+ SelectItem,
+ SelectTrigger,
+ SelectValue,
+} from '@/components/chadcdn/select';
+import { Button } from '@/components/chadcdn/button';
+import { Play, Pause, Square } from 'lucide-react';
+import { Slider } from '@/components/chadcdn/slider';
+import { Controls } from '@/store/store.types';
+import {
+ DEFAULT_EXAMPLE_KEY,
+ EXAMPLES,
+ EXAMPLES_KEYS,
+} from '@/app/(main)/sections/configurator/controls.data';
+
+interface ControlsUiProps {
+ status: Controls['status'];
+ serialisedSpeed: number;
+ speed: number;
+ onPlay: () => void;
+ onResume: () => void;
+ onPause: () => void;
+ onStop: () => void;
+ onSerialisedSpeedChange: (value: number[]) => void;
+ onExampleSelect: (value: string) => void;
+}
+
+export const ControlsUi: FC = ({
+ status,
+ speed,
+ serialisedSpeed,
+ onSerialisedSpeedChange,
+ onExampleSelect,
+ onResume,
+ onPlay,
+ onPause,
+ onStop,
+}) => {
+ const isIdle = status === 'idle';
+ const isPaused = status === 'paused';
+ const isRunning = status === 'running';
+
+ return (
+
+ {isIdle && (
+
+
+
+
+
+
+ {EXAMPLES_KEYS.map((key) => (
+
+ {EXAMPLES[key].title}
+
+ ))}
+
+
+
+
+ RUN
+
+
+ )}
+ {isRunning && (
+
+
+
+
+
+ STOP
+
+
+
+ PAUSE
+
+
+
+ )}
+ {isPaused && (
+
+
+
+
+
+ STOP
+
+
+
+ RESUME
+
+
+
+ )}
+
+ );
+};
diff --git a/app/(main)/sections/configurator/editor.tsx b/app/(main)/sections/configurator/editor.tsx
new file mode 100644
index 0000000..e4cdd7c
--- /dev/null
+++ b/app/(main)/sections/configurator/editor.tsx
@@ -0,0 +1,47 @@
+import { FC, RefObject, useEffect, useRef } from 'react';
+import AceEditor from 'react-ace';
+import 'ace-builds/src-noconflict/mode-javascript';
+import 'ace-builds/src-noconflict/theme-solarized_dark';
+import 'ace-builds/src-noconflict/theme-textmate';
+import { useControlsStore, useEditorStore } from '@/store/store';
+import { useTheme } from 'next-themes';
+
+interface EditorProps {
+ code: string;
+ setCode: (key: string) => void;
+}
+
+export const Editor: FC = ({ code, setCode }) => {
+ const { theme } = useTheme();
+ const editorRef = useRef(null);
+ const setEditorRef = useEditorStore((state) => state.setRef);
+ const status = useControlsStore((state) => state.status);
+ const textTheme = theme === 'light' ? 'textmate' : 'solarized_dark';
+ const readOnly = status !== 'idle';
+
+ useEffect(() => {
+ if (editorRef.current) {
+ setEditorRef(editorRef as RefObject);
+ }
+ }, [editorRef, setEditorRef]);
+
+ return (
+
+ );
+};
diff --git a/app/(main)/sections/console.tsx b/app/(main)/sections/console.tsx
new file mode 100644
index 0000000..2cc03e2
--- /dev/null
+++ b/app/(main)/sections/console.tsx
@@ -0,0 +1,32 @@
+import { FC } from 'react';
+import { InfoContainer } from '@/components/infoContainer';
+import { Card } from '@/components/card';
+import { List } from '@/components/list';
+import { useQueueManagerStore } from '@/store/store';
+
+const description = (
+ <>
+
+ The browser console is a built-in tool within web browsers that allows
+ developers and users to view and interact with a web page's internal
+ state.
+
+
+ It provides a way to examine error messages, debug JavaScript code, and
+ monitor network activity, ultimately helping with troubleshooting and
+ development.
+
+ >
+);
+
+export const Console: FC = () => {
+ const logs = useQueueManagerStore((state) => state.console);
+
+ return (
+
+
+ {(el) => }
+
+
+ );
+};
diff --git a/app/(main)/sections/eventLoop/eventLoop.tsx b/app/(main)/sections/eventLoop/eventLoop.tsx
new file mode 100644
index 0000000..b42e652
--- /dev/null
+++ b/app/(main)/sections/eventLoop/eventLoop.tsx
@@ -0,0 +1,39 @@
+import { FC } from 'react';
+import { InfoContainer } from '@/components/infoContainer';
+import { Wheel } from '@/app/(main)/sections/eventLoop/wheel';
+
+const description = (
+ <>
+
+ The event loop is a fundamental concept in browser that manages the
+ execution of code, handling of events, and updating of the user interface.
+
+
+ The event loop continuously checks for and processes events and queued
+ tasks in a specific order:
+
+
+ 1. Execute all synchronous code in the call stack
+
+ 2. Check the microtask queue (e.g., Promise callbacks) and execute all
+ tasks.
+
+
+ 3. Check the macrotask queue (e.g., setTimeout, DOM events) and execute
+ one task.
+
+ 4. Update the rendering if necessary.
+ 5. Repeat the process.
+
+ >
+);
+
+export const EventLoop: FC = () => {
+ return (
+
+
+
+
+
+ );
+};
diff --git a/src/pages/home/sections/EventLoop/Wheel/Wheel.tsx b/app/(main)/sections/eventLoop/wheel.tsx
similarity index 56%
rename from src/pages/home/sections/EventLoop/Wheel/Wheel.tsx
rename to app/(main)/sections/eventLoop/wheel.tsx
index 5734eb2..1a8860b 100644
--- a/src/pages/home/sections/EventLoop/Wheel/Wheel.tsx
+++ b/app/(main)/sections/eventLoop/wheel.tsx
@@ -1,7 +1,6 @@
-import * as Styled from './Wheel.styled.ts';
-import { useTheme } from '@emotion/react';
-import { useTimeStore, useWheelStore } from 'store/store.ts';
+import { useTimeStore, useWheelStore } from '@/store/store';
import { useEffect } from 'react';
+import { cn } from '@/utils/utils';
const POINTER_TOP_ID = 'wheel-pointer-top';
const POINTER_BOTTOM_ID = 'wheel-pointer-bottom';
@@ -9,45 +8,25 @@ const POINTER_LEFT_ID = 'wheel-pointer-left';
const POINTER_RIGHT_ID = 'wheel-pointer-right';
const WHEEL_ID = 'wheel';
-const MICROTASK_CLASS = 'microtask';
-const MACROTASK_CLASS = 'macrotask';
-const RENDER_CLASS = 'render';
+const MICROTASK_CLASS = 'microtask fill-[var(--chart-1)]';
+const MACROTASK_CLASS = 'macrotask fill-[var(--chart-2)]';
+const RENDER_CLASS = 'render fill-[var(--chart-3)]';
const SEGMENT_OFFSET = -9;
const POINTER_OFFSET = -99;
+const FONT_WEIGHT = 500;
+const FONT_SIZE = 11;
-function Wheel() {
- const {
- custom: { sys, com },
- } = useTheme();
- const { render, macrotask, microtask } = useWheelStore((state) => state);
- const fontWeight = 500;
+export const Wheel = () => {
+ const { render, macrotask, microtask } = useWheelStore();
- const colors = {
- text: sys.colors.onBackground,
- pointer: com.wheel.pointer,
- wheel: com.wheel.background,
- background: sys.colors.container,
- border: sys.colors.border,
- microtask: {
- disabled: com.wheel.microtask.dim,
- enabled: com.wheel.microtask.contrast,
- },
- macrotask: {
- disabled: com.wheel.macrotask.dim,
- enabled: com.wheel.macrotask.contrast,
- },
- render: {
- disabled: com.wheel.render.dim,
- enabled: com.wheel.render.contrast,
- },
- };
-
- const fill = {
- render: render ? colors.render.enabled : colors.render.disabled,
- macrotask: macrotask ? colors.macrotask.enabled : colors.macrotask.disabled,
- microtask: microtask ? colors.microtask.enabled : colors.microtask.disabled,
- };
+ const renderClass = render ? RENDER_CLASS : cn(RENDER_CLASS, 'opacity-25');
+ const microtaskClass = microtask
+ ? MICROTASK_CLASS
+ : cn(MICROTASK_CLASS, 'opacity-25');
+ const macrotaskClass = macrotask
+ ? MACROTASK_CLASS
+ : cn(MACROTASK_CLASS, 'opacity-25');
useEffect(() => {
return useTimeStore.subscribe(({ grad }) => {
@@ -68,8 +47,8 @@ function Wheel() {
}, []);
return (
-
-
+
-
+
Microtask
-
+
Render
Microtask
Microtask
Task
Microtask
@@ -140,25 +115,25 @@ function Wheel() {
cx="0"
cy="0"
r="69"
- fill={colors.background}
+ className="fill-[var(--card)]"
/>
@@ -167,65 +142,63 @@ function Wheel() {
cx="0"
cy="0"
r="66"
- fill={colors.background}
+ className="fill-[var(--card)]"
/>
mTMicrotask
mTMicrotask
mTMicrotask
mTMicrotask
RRender
TTask
-
-
+
+
);
-}
-
-export default Wheel;
+};
diff --git a/app/(main)/sections/microtasksQueue.tsx b/app/(main)/sections/microtasksQueue.tsx
new file mode 100644
index 0000000..a0344cb
--- /dev/null
+++ b/app/(main)/sections/microtasksQueue.tsx
@@ -0,0 +1,34 @@
+import { FC } from 'react';
+import { InfoContainer } from '@/components/infoContainer';
+import { Card } from '@/components/card';
+import { List } from '@/components/list';
+import { useQueueManagerStore } from '@/store/store';
+
+const description = (
+ <>
+
+ A microtask is a short function which is executed after the function or
+ program which created it exits and only if the JavaScript execution stack
+ is empty, but before returning control to the event loop being used by the
+ user agent to drive the script's execution environment.
+
+ Events that can trigger new microtasks:
+
+ - Promise resolution (.then(), .catch(), .finally())
+ - Occurrence of observed DOM changes
+ - queueMicrotask() method
+
+ >
+);
+
+export const MicrotasksQueue: FC = () => {
+ const microtasks = useQueueManagerStore((state) => state.microtask);
+
+ return (
+
+
+ {(el) => }
+
+
+ );
+};
diff --git a/app/(main)/sections/requestAnimaitionFrame.tsx b/app/(main)/sections/requestAnimaitionFrame.tsx
new file mode 100644
index 0000000..e4c0709
--- /dev/null
+++ b/app/(main)/sections/requestAnimaitionFrame.tsx
@@ -0,0 +1,41 @@
+import { FC } from 'react';
+import { InfoContainer } from '@/components/infoContainer';
+import { List } from '@/components/list';
+import { Card } from '@/components/card';
+import { useQueueManagerStore } from '@/store/store';
+
+const description = (
+ <>
+
+ The window.requestAnimationFrame() method tells the browser you wish to
+ perform an animation. It requests the browser to call a user-supplied
+ callback function before the next repaint.
+
+
+ The frequency of calls to the callback function will generally match the
+ display refresh rate. The most common refresh rate is 60hz, (60
+ cycles/frames per second), though 75hz, 120hz, and 144hz are also widely
+ used.
+
+
+ requestAnimationFrame() calls are paused in most browsers when running in
+ background tabs or hidden iframes, in order to improve performance and
+ battery life.
+
+ >
+);
+
+export const RequestAnimationFrame: FC = () => {
+ const rafCallback = useQueueManagerStore((state) => state.rafCallback);
+
+ return (
+
+
+ {(el) => }
+
+
+ );
+};
diff --git a/app/(main)/sections/tasksQueue.tsx b/app/(main)/sections/tasksQueue.tsx
new file mode 100644
index 0000000..cbbba42
--- /dev/null
+++ b/app/(main)/sections/tasksQueue.tsx
@@ -0,0 +1,44 @@
+import { FC } from 'react';
+import { InfoContainer } from '@/components/infoContainer';
+import { Card } from '@/components/card';
+import { List } from '@/components/list';
+import { useQueueManagerStore } from '@/store/store';
+
+const description = (
+ <>
+
+ A task is anything which is scheduled to be run by the standard mechanisms
+ such as initially starting to run a program, an event being dispatched
+ asynchronously, or an interval or timeout being fired. These all get
+ scheduled on the task queue.
+
+ For example, tasks get added to the task queue when:
+
+
+ - a new JavaScript program or subprogram is executed (such as from a
+ console, or by running the code in a {'
-