![Malicious npm Package Typosquats react-login-page to Deploy Keylogger](https://cdn.sanity.io/images/cgdhsj6q/production/007b21d9cf9e03ae0bb3f577d1bd59b9d715645a-1024x1024.webp?w=400&fit=max&auto=format)
Research
Security News
Malicious npm Package Typosquats react-login-page to Deploy Keylogger
Socket researchers unpack a typosquatting package with malicious code that logs keystrokes and exfiltrates sensitive data to a remote server.
little-state-machine
Advanced tools
Readme
Flux state management should be easy
$ npm install little-state-machine
Check out the Demo.
// individual action
Action: (store: Object, payload: any) => void;
// multiple actions
Actions: { [key: string] : Action }
// options to name action in debug, and weather trigger global state update to re-render entire app
Options: {
debugName: string, // unique debug name can really help you :)
shouldReRenderApp: boolean,
}
useStateMachine(Action | Actions, Options) =>
{ action: (any) => void, actions: { [key: string] : (any) => void}, state: Object }
This hook function will return action/actions and state of the app.
window.STATE_MACHINE_DEBUG
This will turn on the dev tool at console.
window.STATE_MACHINE_DEBUG(true)
to turn debug on in console
window.STATE_MACHINE_DEBUG(false)
to turn off debug on in console
StateMachineProvider
This is a Component to wrapper around your entire app in order to create context.
createStore
Function to initial the global store, call at app root where StateMachineProvider
is.
store
The global store.
app.js
import React, { useState } from 'react'
import state from './state'
import YourComponent from './yourComponent'
import { StateMachineProvider, store, createStore } from 'little-state-machine'
// create your store
createStore({
state,
});
const App = ({children}) => {
const [globalState, updateStore] = useState(store);
return <StateMachineProvider
value={{
store: globalState,
updateStore,
}}
>
<YourComponent />
</StateMachineProvider>
}
yourComponent.js
import React from 'react'
import { updateName } from './action.js'
import { useStateMachine } from 'little-state-machine'
export default function YourComponent() {
const {
action,
state: { name },
} = useStateMachine(updateName);
return <div onClick={() => action('bill')}>
{name}
</div>
}
state.js
export default {
name: 'test',
}
action.js
export function updateName(state, payload) {
return {
...state,
name: payload,
}
}
FAQs
Unknown package
We found that little-state-machine demonstrated a not healthy version release cadence and project activity because the last version was released 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
Security News
Socket researchers unpack a typosquatting package with malicious code that logs keystrokes and exfiltrates sensitive data to a remote server.
Security News
The JavaScript community has launched the e18e initiative to improve ecosystem performance by cleaning up dependency trees, speeding up critical parts of the ecosystem, and documenting lighter alternatives to established tools.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.