New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

solid-tiny-utils

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

solid-tiny-utils

A collection of tiny utilities for SolidJS applications

Source
npmnpm
Version
0.2.0
Version published
Weekly downloads
15
-65.12%
Maintainers
1
Weekly downloads
 
Created
Source

solid-tiny-utils

Tiny utilities for SolidJS applications.

Installation

pnpm add solid-tiny-utils

Usage

import { access, createWatch, CreateLoopExec, isFn, isArray } from 'solid-tiny-utils';

API

Reactive

access(value)

Safely access a value that might be an accessor function.

const value = access(maybeAccessor); // Returns the value directly or calls the accessor

createWatch(targets, fn, options?)

Create a watcher that runs when dependencies change.

createWatch(() => signal(), (value) => {
  console.log('Value changed:', value);
});

Functions

CreateLoopExec(fn, delay)

Execute a function in a loop with cleanup support.

CreateLoopExec(
  async () => {
    // Your async work here
  },
  1000 // Delay in milliseconds
);

Type Guards

isFn(value)

Check if a value is a function.

if (isFn(value)) {
  value(); // TypeScript knows it's a function
}

isArray(value)

Check if a value is an array.

if (isArray(value)) {
  value.forEach(...); // TypeScript knows it's an array
}

Types

type MaybeArray<T> = T | T[];
type MaybePromise<T> = T | Promise<T>;
type MaybeAccessor<T> = T | Accessor<T>;

Keywords

solidjs

FAQs

Package last updated on 11 Aug 2025

Related posts