Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
redux-pouchdb-middleware
Advanced tools
A redux middleware to sync data between redux with pouchdb and vice-versa.
A redux middleware to sync data between redux with pouchdb and vice-versa.
Inspired and forked from pouch-redux-middleware
$ yarn add redux-pouchdb-middleware
or,
$ npm install redux-pouchdb-middleware
An example React-redux store configuration.
import {
applyMiddleware,
compose,
createStore,
} from "redux"
import { ReduxPouchDBMiddleware } from "redux-pouchdb-middleware"
import PouchDB from "pouchdb"
import reducers from "./reducers"
import { initialLoad } from "./reducers/actions"
const initialStore = {}
const middleware = []
const enhancers = []
middleware.push(ReduxPouchDBMiddleware({
reducer: "todos",
verbose: false,
db: new PouchDB("todos-store", { adapter }),
actions: {
initialInsert: todos => initialLoad(todos),
},
excludeKeys: ["id"]
}))
const composedEnhancers = compose(applyMiddleware(...middleware), ...enhancers)
export default createStore(reducers, initialStore, composedEnhancers)
ReduxPouchDBMiddleware(options)
options
: array|object. An array of objects or simply object with specs as specified below.reducer
: string|required. Name of the reducer to store data. Its a json data key for store's root reducer.db
: required. an instance of PouchDB Database.verbose
: boolean|optional(default = false). Weather to print logs in console or not.actions
: an object describing the actions to perform when initially inserting items and when a change occurs in the db.actions.initialInsert
: redux action to store data from pouchDB to store on app load.actions.includeKeys
: string[]|optional. An array of string of keys to include to save in pouchdb for this specific redux reducers. If not provided, all keys will be saved except provided in excludeKeys
key.actions.excludeKeys
: string[]|optional. An array of string of keys to exclude saving in pouchdb for this specific redux reducers.MIT
FAQs
A redux middleware to sync data between redux with pouchdb and vice-versa.
We found that redux-pouchdb-middleware 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.