Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
prism-observable
Advanced tools
Утилита для использования redux-observable вместе с prism. Оборачивает epics, позволяя им работать с префикснутыми actions, а также с частью store, относящейся к компоненту.
This package fixes the problem of multiple same epics. You can read more about epics here https://redux-observable.js.org. By default epics can listen certain actions, but if those actions came from same components epic could not differ it.
That's why we should pass some identifier (prefix or smth else) to totaly define correct action.
$ npm install prism-observable --save
import { combineEpics } from 'redux-observable';
import { wrapEpic } from 'prism-observable';
// the target epic
const fetchCities = action$ => {
return action$.ofType('FETCH')
.debounceTime(300)
.switchMap(({ url }) =>
ajax({url: url, crossDomain: true})
.map(result => ({
type: 'FULFILL',
payload: result.response
}))
);
}
// the function identifier
// it listen all possible actions apply to regexp
const getPrefix = action => {
const match = action.type.match(/^routes\.[\d].(from|to)/);
return match ? match[0] : null;
}
export default combineEpics(
wrapEpic(fetchCities, getPrefix),
);
The function getPrefix
makes possible to listen actions such as routes.1.from.FETCH
, routes.0.to.FETCH
... After epic makes it's deal wrapEpic
wraps the output action by appending the prefix. It case routes.1.from.FETCH
you will get routes.1.from.FULFILL
The signature is wrapEpic(epic, getPrefix, selector)
;
Name | Type | Required | Description |
---|---|---|---|
epic | function | true | The target epic to wrap |
getPrefix | `function | string` | true |
selector | function | false | The state slice selector for the second epic argument. |
FAQs
Утилита для использования redux-observable вместе с prism. Оборачивает epics, позволяя им работать с префикснутыми actions, а также с частью store, относящейся к компоненту.
The npm package prism-observable receives a total of 0 weekly downloads. As such, prism-observable popularity was classified as not popular.
We found that prism-observable 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.
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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.