Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

storeon-observable

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

storeon-observable - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

index.d.ts

7

CHANGELOG.md

@@ -5,4 +5,9 @@ # Change Log

## 0.2.0
- **typings:** Add type definition (#2)[https://github.com/distolma/storeon-observable/issues/2] ((26d46a2)[https://github.com/distolma/storeon-observable/commit/26d46a2])
## 0.1.0
- Move Rxjs to the peerDependencies.
## 0.0.1
- Initial release.

@@ -0,0 +0,0 @@ var operators = require('rxjs/operators')

4

package.json
{
"name": "storeon-observable",
"version": "0.1.0",
"version": "0.2.0",
"description": "RxJS based module for Storeon which allows to create async actions",

@@ -13,3 +13,3 @@ "main": "index.js",

"lint": "eslint *.js",
"test": "yarn lint && size-limit"
"test": "jest --coverage && yarn lint && size-limit"
},

@@ -16,0 +16,0 @@ "peerDependencies": {

@@ -17,3 +17,3 @@ # Storeon Observable

## Install
This module has peer dependencie of `rxjs@6.x.x` which will has to be installed as well.
```sh

@@ -25,5 +25,5 @@ npm install storeon-observable

Create simple epic using RxJS operators.
You need to create epic using RxJS operators. This epic will listen to event `ping`, wait for 1 second and map them to a new event, `pong`
#### `epics.js`
#### `epic.js`
```javascript

@@ -42,3 +42,3 @@ import { combineEpics, ofEvent } from 'storeon-observable';

Connect all epics to the Storeon using the `storeon-observable` middleware
Create store and pass `epics` to the `createEpicMiddleware` function. It will connect all epics to the Storeon using the `storeon-observable` middleware

@@ -59,2 +59,30 @@ #### `store.js`

export const store = createStore([increment, createEpicMiddleware(epics)]);
```
```
Using TypeScript you can assign `Epic` interface to the function to specify `action` and `state` typing
#### `epic.ts`
```typescript
import { combineEpics, ofEvent, Epic } from 'storeon-observable';
import { mapTo, delay } from 'rxjs/operators'
interface State {
isPinging: boolean;
}
const epic: Epic<State> = (action$, state$) => action$.pipe(
ofEvent('ping'),
delay(1000),
mapTo('pong'),
);
export const epics = combineEpics([epic]);
```
## Acknowledgments
This module based on [redux-observable](https://github.com/redux-observable/redux-observable).
## License
[MIT](LICENCE)

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc