
Security News
PEP 810 Proposes Explicit Lazy Imports for Python 3.15
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
@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
The npm package @kalxjs/composition receives a total of 1 weekly downloads. As such, @kalxjs/composition popularity was classified as not popular.
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.
Security News
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.