
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
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
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.