UNPKG

@dnd-kit-svelte/svelte

Version:

[![Stable release](https://img.shields.io/npm/v/@dnd-kit-svelte/svelte.svg)](https://npm.im/@dnd-kit-svelte/svelte)

18 lines (17 loc) 380 B
import { isObject } from '../is.js'; export const BoxSymbol = Symbol('box'); export function box(value) { let _state = $state(value); return { [BoxSymbol]: true, get current() { return _state; }, set current(v) { _state = v; }, }; } export function isBox(r) { return isObject(r) && BoxSymbol in r; }