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

lightcast

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lightcast - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

2

package.json
{
"name": "lightcast",
"version": "0.1.4",
"version": "0.1.5",
"author": "skulptur",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -30,1 +30,42 @@ ## Motivation

```
Working with groups
```typescript
// say you have a piece of code that accepts callbacks for events
const loader = createLoader({
onProgress: (progress) => console.log(progress),
onComplete: () => console.log('done'),
})
```
```typescript
import { createPubSub } from 'lightcast'
const pubSub = {
onProgress: createPubSub<number>(),
onComplete: createPubSub<void>(),
}
// you could make it work like this...
const loader = createLoader({
onProgress: pubSub.onProgress.dispatch,
onComplete: pubSub.onComplete.dispatch,
// ...
})
```
```typescript
import { createPubSub, groupByAction } from 'lightcast'
// but it is easier to group by dispatch/subscribe/dispose
const pubSub = groupByAction({
onProgress: createPubSub<number>(),
onComplete: createPubSub<void>(),
})
const loader = createLoader({
...pubSub.dispatch,
// ...
})
```
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