@benev/slate
Advanced tools
Comparing version 0.0.0-dev.10 to 0.0.0-dev.11
{ | ||
"name": "@benev/slate", | ||
"version": "0.0.0-dev.10", | ||
"version": "0.0.0-dev.11", | ||
"description": "frontend web stuff", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -62,3 +62,3 @@ | ||
prepare<T>(prep: () => T) { | ||
prepare<T>(prep: () => T): T { | ||
const count = this.#counter.value++ | ||
@@ -70,3 +70,3 @@ return maptool(this.#preparations).grab(count, prep) | ||
const count = this.#counter.value++ | ||
const value = maptool(this.#states).grab(count, () => ( | ||
const value: T = maptool(this.#states).grab(count, () => ( | ||
(typeof init === "function") | ||
@@ -80,3 +80,3 @@ ? (init as () => T)() | ||
} | ||
const getter = () => this.#states.get(count) | ||
const getter = () => this.#states.get(count) as T | ||
return [value, setter, getter] as const | ||
@@ -83,0 +83,0 @@ } |
@@ -15,4 +15,4 @@ import { Context } from "../../../context.js"; | ||
setup(up: Setup): void; | ||
prepare<T>(prep: () => T): any; | ||
state<T>(init: T | (() => T)): readonly [any, (v: T) => void, () => any]; | ||
prepare<T>(prep: () => T): T; | ||
state<T>(init: T | (() => T)): readonly [T, (v: T) => void, () => T]; | ||
flatstate<S extends Record<string, any>>(init: S | (() => S)): S; | ||
@@ -19,0 +19,0 @@ signal<T>(init: T | (() => T)): Signal<T>; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
570072