rynex
Version:
A minimalist TypeScript framework for building reactive web applications with no virtual DOM
28 lines • 877 B
TypeScript
/**
* Rynex State Management
* Vanilla JavaScript Proxy-based reactive state (no React hooks)
*/
type Listener = () => void;
type EffectFunction = () => void;
/**
* Create a reactive state object using Proxy
* Any property access is tracked, any property change triggers updates
*/
export declare function state<T extends object>(initialState: T): T;
/**
* Create a computed value that automatically updates when dependencies change
*/
export declare function computed<T>(computeFn: () => T): {
value: T;
};
/**
* Run an effect when reactive dependencies change
*/
export declare function effect(effectFn: EffectFunction): () => void;
/**
* Subscribe to state changes manually
*/
export declare function subscribe(stateObj: any, listener: Listener): () => void;
export declare function batch(fn: () => void): void;
export {};
//# sourceMappingURL=state.d.ts.map