npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@bemedev/app-solid

v0.5.1

Published

Middleware between @bemedev/app-ts and solidjs

Readme

@bemedev/app-solid

A TypeScript middleware for integrating @bemedev/app-ts finite state machines with SolidJS.

Description

This library serves as a bridge between @bemedev/app-ts (finite state machine library) and SolidJS, enabling the use of reactive state machines in SolidJS applications.

Key Features

  • 🔗 SolidJS Integration: Connects @bemedev/app-ts state machines with SolidJS signals
  • Reactivity: Automatic synchronization between machine state and SolidJS components
  • 🎯 TypeScript Types: Preserves type safety between both libraries
  • 🔄 Transparent Middleware: Simple interface for using state machines in SolidJS

Installation

npm

npm install @bemedev/app-solid @bemedev/app-ts solid-js

pnpm

pnpm install @bemedev/app-solid @bemedev/app-ts solid-js

Usage

Basic Example

import { createInterpreter } from '@bemedev/app-solid';
import { createMachine } from '@bemedev/app-ts';

// Define your state machine
const toggleMachine = createMachine({
  initial: 'inactive',
  states: {
    inactive: {
      on: { TOGGLE: '/active' }
    },
    active: {
      on: { TOGGLE: '/inactive' }
    }
  }
});

// Create an interpreter
const interpreter = createInterpreter({
  machine: toggleMachine,
  options: {
    context: {},
    pContext: {}
  }
});

// Start the interpreter
interpreter.start();

// In your SolidJS component
function MyComponent() {
  const value = interpreter.value();
  const currentState = value();

  return (
    <div>
      <p>Current state: {currentState}</p>
      <button onClick={() => interpreter.send('TOGGLE')}>
        Toggle
      </button>
    </div>
  );
}

Runtime Options Override

You can override machine options at runtime using provideOptions:

const interpreter = createInterpreter({
  machine: myMachine,
  options: {
    context: { count: 0 },
    pContext: {},
  },
}).provideOptions(({ assign }) => ({
  actions: {
    increment: assign(
      'context.count',
      ({ context: { count } }) => count + 2,
    ),
  },
}));

State Matching & Tags

// Check if current state matches
const isActive = interpreter.matches('active');

// Check if state contains a value
const hasWorking = interpreter.contains('working');

// Check for tags
const hasTags = interpreter.hasTags('loading', 'visible');

UI Thread (External State Management)

You can add UI state that exists outside the machine's internal state using uiThread. This is useful for managing UI-specific state (like form inputs, loading indicators, etc.) that needs to be reactive but shouldn't be part of the machine's state logic. Generally, it's a problem of speed.

import { createSignal } from 'solid-js';

// Define UI signals outside the machine
const [username, setUsername] = createSignal('');
const [email, setEmail] = createSignal('');

const interpreter = createInterpreter({
  machine: myMachine,
  options: {
    context: {},
    pContext: {}
  },
  uiThread: {
    username: [username, setUsername],
    email: [email, setEmail]
  }
});

// Access UI state in components
function MyComponent() {
  const ui = interpreter.ui();
  const currentUsername = ui()?.username;

  return (
    <div>
      <input
        value={currentUsername || ''}
        onInput={(e) => interpreter.sendUI({
          type: 'username',
          payload: e.currentTarget.value
        })}
      />
    </div>
  );
}

Key points:

  • UI thread state is separate from the machine's internal context
  • Perfect for form inputs, UI toggles, and temporary UI state
  • Very fast for efficent UI updates, avoiding unnecessary machine state transitions
  • Reactive through SolidJS signals
  • Accessible via interpreter.ui() and interpreter.sendUI()

Licence

MIT

CHANGE_LOG

CHANGELOG

Auteur

chlbri ([email protected])

My github

Liens