
Product
Announcing Socket Certified Patches: One-Click Fixes for Vulnerable Dependencies
A safer, faster way to eliminate vulnerabilities without updating dependencies
@kalxjs/composition
Advanced tools
Composition API utilities for KalxJs framework.
npm install @kalxjs/composition
import { useWindowSize, useLocalStorage, useMouse, useForm, useDebounce, useAsync } from '@kalxjs/composition';
// Window size hook
const { width, height, breakpoints } = useWindowSize();
console.log(width.value, height.value);
console.log(breakpoints.isMobile.value);
// Local storage hook
const { value, setValue, removeItem } = useLocalStorage('user-preferences', { theme: 'light' });
setValue({ theme: 'dark' });
// Mouse position hook
const { x, y } = useMouse();
console.log(x.value, y.value);
// Form handling hook
const { values, errors, touched, isSubmitting, isValid, setValue, reset, handleSubmit } = useForm(
{ name: '', email: '' },
(values) => {
const errors = {};
if (!values.name) errors.name = 'Name is required';
if (!values.email) errors.email = 'Email is required';
return errors;
},
async (values) => {
await api.post('/users', values);
}
);
// Debounce hook
const searchTerm = ref('');
const debouncedSearchTerm = useDebounce(searchTerm, 500);
// Async hook
const { isLoading, error, data, execute } = useAsync(async (id) => {
const response = await fetch(`https://api.example.com/users/${id}`);
return response.json();
});
// Execute the async function
execute(1);
Track window dimensions with reactive references.
Persist state in localStorage with automatic serialization/deserialization.
Track mouse position with reactive references.
Manage form state, validation, and submission.
Create a debounced version of a reactive value.
Handle async operations with loading, error, and data states.
MIT
FAQs
Composition API utilities for KalxJs framework
We found that @kalxjs/composition demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
A safer, faster way to eliminate vulnerabilities without updating dependencies

Product
Reachability analysis for Ruby is now in beta, helping teams identify which vulnerabilities are truly exploitable in their applications.

Research
/Security News
Malicious npm packages use Adspect cloaking and fake CAPTCHAs to fingerprint visitors and redirect victims to crypto-themed scam sites.