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.
@specter/redux-effects-specter-cache
Advanced tools
cache structure for redux middleware of specter
Caching middleware for @specter/redux-effects-specter.
npm install --save @specter/specter \ # peer dependency
@specter/storage \ # peer dependency
@specter/redux-effects-specter \ # peer dependency
@specter/redux-effects-specter-cache
Installing the middleware:
import { createStore, applyMiddleware } from 'redux';
import { Client } from '@specter/specter';
import stepsMiddleware from 'redux-effects-steps';
import specterMiddleware from '@specter/redux-effects-specter';
import specterCacheMiddleware from '@specter/redux-effects-specter-cache';
import rootReducer from './reducers';
const client = new Client({
base: '/xhr'
});
const cacheConfig = {
max: 500,
maxAge: 1000 * 60 * 60
};
const cacheMiddlewareConfig = {
excludes: [
"greet" // expected service name of specter
]
}
const store = createStore(
rootReducer,
applyMiddleware(
stepsMiddleware,
specterCacheMiddleware({ cacheConfig, cacheMiddlewareConfig }),
specterMiddleware(client)
)
);
redux-effects-specter-cache must be applied before redux-effects-specter.
specterCacheMiddleware(cacheConfig, [options])
Creates redux middleware.
options
(Object) : LRE-cache option and middleware option
cacheConfig
(Object): See
lru-cahce API docs
for more info.middlewareOption
(Object):
excludes
(Array): An array of the resource names to not use the cache.
Defaults []
.fromCache
(Function): Checks whether an action is target to obtain from cache.
Defaults () => true
.
action
(Object): An action.state
(Object): The current state of the Store.true
, uses cache to obtain the resource.toCache
(Function): Checks whether an action is target to store to cache.
Defaults () => true
.
action
(Object): An action.state
(Object): The current state of the Store.true
, saves the obtaining resource to cache.resetCache
(Function): reset cache if resetCache function returns true.
Defaults () => false
.
action
(Object): An action.state
(Object): The current state of the Store.true
, reset all cache.FAQs
cache structure for redux middleware of specter
We found that @specter/redux-effects-specter-cache demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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.