
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@kalxjs/state
Advanced tools
Next-generation state management for kalxjs applications with composables, TypeScript, and optimized performance.
npm install @kalxjs-framework/state
import { defineStore } from '@kalxjs-framework/state'
import type { State, Actions, Getters } from '@kalxjs-framework/state'
// Define store types
interface TodoState {
items: Todo[]
filter: 'all' | 'active' | 'completed'
}
// Create type-safe store
const useTodoStore = defineStore<TodoState>({
id: 'todos',
state: () => ({
items: [],
filter: 'all'
}),
actions: {
async addTodo(text: string) {
const todo = await api.createTodo({ text })
this.items.push(todo)
}
},
getters: {
filtered(): Todo[] {
return this.items.filter(todo =>
this.filter === 'all' ||
todo.completed === (this.filter === 'completed')
)
}
}
})
// Use in components
const TodoList = defineComponent({
setup() {
const store = useTodoStore()
const todos = computed(() => store.filtered)
return { todos }
}
})
// Composable state logic
function useAuth() {
const user = signal<User | null>(null)
const isLoggedIn = computed(() => !!user())
async function login(credentials: Credentials) {
user.value = await api.login(credentials)
}
return {
user,
isLoggedIn,
login
}
}
// Use in store
const useAppStore = defineStore({
compose: () => {
const auth = useAuth()
const todos = useTodoStore()
return {
auth,
todos
}
}
})
import { persistence } from '@kalxjs-framework/state'
const store = defineStore({
persist: {
storage: localStorage,
paths: ['user', 'settings'],
serializer: {
serialize: JSON.stringify,
deserialize: JSON.parse
}
}
})
import { batch, transaction } from '@kalxjs-framework/state'
// Batch multiple commits
batch(() => {
store.commit('updateMany', items)
store.commit('updateStatus', 'done')
})
// Transactional updates
transaction(async () => {
await store.dispatch('transferFunds')
await store.dispatch('updateBalance')
})
MIT
FAQs
Component state management for KalxJS framework
We found that @kalxjs/state 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.