app-saga-utils
Advanced tools
Comparing version 0.9.1 to 1.0.0
export * from "./IWatcher"; | ||
export * from "./RootSagaBase"; | ||
export * from "./WatcherBase"; | ||
export * from "./RootSaga"; | ||
export * from "./Watcher"; | ||
export * from "./WatchFunction"; |
export * from "./IWatcher"; | ||
export * from "./RootSagaBase"; | ||
export * from "./WatcherBase"; | ||
export * from "./RootSaga"; | ||
export * from "./Watcher"; | ||
export * from "./WatchFunction"; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import { TakeEffect, ForkEffect, PutEffect } from "@redux-saga/core/effects"; | ||
export declare type WatchFunction = () => IterableIterator<ForkEffect | TakeEffect | PutEffect>; | ||
import { SimpleEffect } from "@redux-saga/core/effects"; | ||
export declare type WatchFunction = () => IterableIterator<SimpleEffect<any>>; |
{ | ||
"name": "app-saga-utils", | ||
"version": "0.9.1", | ||
"version": "1.0.0", | ||
"description": "Helpful utils for redux-saga", | ||
@@ -5,0 +5,0 @@ "contributors": [ |
@@ -8,3 +8,38 @@ # Installation | ||
```ts | ||
// User.watcher.ts | ||
import { Watcher } from "app-saga-utils"; | ||
import { UserActions } from "../redux"; | ||
import { UserSaga } from "./User.saga"; | ||
export class UserWatcher extends Watcher { | ||
constructor() { | ||
super(); | ||
this.watchLatest( | ||
UserActions.SET_USER, | ||
UserSaga.setUser | ||
); | ||
} | ||
} | ||
``` | ||
```ts | ||
// RootSagaBase.ts | ||
import { RootSaga } from "app-saga-utils"; | ||
import { UserWatcher } from "./User.watcher"; | ||
export class RootSagaBase extends RootSaga { | ||
constructor() { | ||
super(); | ||
this.addWatchers([ | ||
new UserWatcher(), | ||
]); | ||
} | ||
} | ||
``` | ||
and register your saga like usually `new RootSagaBase().run(sagaMiddleware);` |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
13107
24
152
1
45