open-index/open-npm huggingface dataset:
npm package: @stateloom/vue
Description: Vue 3 adapter for StateLoom — composables bridging reactive signals to Vue refs
Latest version: 1.0.0-alpha.0

# @stateloom/vue

Vue 3 adapter for StateLoom -- composables bridging reactive signals to Vue refs via `shallowRef` + `effect()`.

## Install

```bash
pnpm add @stateloom/vue @stateloom/core
```

## Quick Start

```vue
<script setup>
import { signal, computed } from '@stateloom/core';
import { useSignal } from '@stateloom/vue';

const count = signal(0);
const doubled = computed(() => count.get() * 2);

const countRef = useSignal(count);
const doubledRef = useSignal(doubled);
</script>

<template>
  <button @click="count.set(count.get() + 1)">{{ countRef }} x2 = {{ doubledRef }}</button>
</template>
```

## API

| Export                                | Purpose                                        |
| ------------------------------------- | ---------------------------------------------- |
| `useSignal(source)`                   | Bridge any `Subscribable<T>` to a Vue `Ref<T>` |
| `useStore(store, selector?, equals?)` | Store integration with selector memoization    |
| `stateloomPlugin`                     | Vue plugin for app-level scope injection       |
| `provideScope(scope)` / `useScope()`  | Composable scope provide/inject                |
| `ScopeProvider`                       | Renderless component for scope boundaries      |

## Requirements

- Vue 3.2+ (for `onScopeDispose`)
- `@stateloom/core` (required peer dependency)
- `@stateloom/store` (optional peer dependency)

## Documentation

Full documentation with examples, API reference, patterns, and migration guides: [docs/api/vue](../../docs/api/vue/)

## License

MIT