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

tinysaga

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tinysaga - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

2

package.json
{
"name": "tinysaga",
"version": "0.3.0",
"version": "0.3.1",
"main": "lib/index.js",

@@ -5,0 +5,0 @@ "module": "esm/index.js",

@@ -62,2 +62,4 @@ [![](https://img.shields.io/circleci/build/github/crazytoucan/tinysaga)](https://app.circleci.com/pipelines/github/crazytoucan/tinysaga?branch=master)

This snippet shows how multiple action types can be combined to implement complex behavior. Here we use `lodash.debounce()` for most of the heavy lifting.
```ts

@@ -86,1 +88,27 @@ const DismissPopover = defineAction("DismissPopover");

```
For comparison, equivalent Redux-Saga code is something like:
```ts
const DismissPopover = defineAction("DismissPopover");
const PopoverAnchorEnter = defineAction("PopoverAnchorEnter");
const PopoverEnter = defineAction("PopoverEnter");
function popoverSaga() {
yield fork(function* () {
while (true) {
yield takeLatest(DismissPopover.TYPE, function* () {
const { pass } = yield race({
anchorEnter: take(PopoverAnchorEnter.TYPE),
enter: take(PopoverEnter.TYPE),
pass: delay(500),
});
if (pass) {
yield put(DismissPopoverInternal()); // goes off to a reducer somewhere
}
};
}
});
}
```
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