Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
cerebral-module-fuse
Advanced tools
A cerebral module that adds fuzzy search to data in the store.
npm install cerebral-module-fuse
From your main.js
import controller from './controller'
import fuse form 'cerebral-module-fuse'
controller.modules({
findUsers: fuse({
statePath: ['users'], // statePath should point to either an object or array in the store
options: { keys: ['firstName', 'lastName'] } // options are passed on to fuse.js
})
})
See fuse docs for more information about available options.
from your component.js
import React from 'react';
import { Decorator as Cerebral } from 'cerebral-view-react';
import fuse from 'cerebral-module-fuse/compute';
@Cerebral({
users: fuse(['findUsers']) // where fuse is given the path to the module state
})
class App extends React.Component {
render() {
return (
<ul>
{this.props.users.map(user => (
<li>{`${user.firstName} ${user.lastName}`}</li>
))}
</ul>
);
}
}
to execute the search simply call the search
signal and the view will automatically update
signals.findUsers.search({ query: 'John' })
you can also access the filtered data from an action via the provided services
export default myAction({ state, services: { findUsers } }) {
const users = state.get(findUsers.fuse)
}
Fork repo
npm install
npm start
runs dev mode which watches for changes and auto lints, tests and buildsnpm test
runs the testsnpm run lint
lints the codenpm run build
compiles es6 to es5FAQs
A cerebral module that adds fuzzy search to data in store
We found that cerebral-module-fuse 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 uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.