New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rx-sample

Package Overview
Dependencies
Maintainers
0
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rx-sample - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

21

dist/index.d.ts

@@ -0,13 +1,24 @@

import { Event as Event_2 } from 'effector';
import { EventCallable } from 'effector';
import { Observable } from 'rxjs';
import { Store } from 'effector';
declare type Input<D, S, U> = {
declare type Input<D> = {
source: Observable<D>;
subscribeOn: EventCallable<S>;
unsubscribeOn: EventCallable<U>;
target: EventCallable<D> | EventCallable<void>;
subscribeOn: Event_2<unknown>;
unsubscribeOn: Event_2<unknown>;
target: EventCallable<D>;
};
export declare const rxSample: <D, S, U>({ source, subscribeOn, unsubscribeOn, target, }: Input<D, S, U>) => void;
declare type InputWithStore<D> = {
source: Store<Observable<D>>;
subscribeOn: Event_2<unknown>;
unsubscribeOn: Event_2<unknown>;
target: EventCallable<D>;
};
export declare function rxSample<D>(config: Input<D>): void;
export declare function rxSample<D>(config: InputWithStore<D>): void;
export { }

@@ -1,28 +0,38 @@

import { createStore as u, createEffect as o, sample as c } from "effector";
const p = ({
source: s,
subscribeOn: a,
unsubscribeOn: n,
target: b
}) => {
const t = u(null), r = o(
() => s.subscribe(b)
), l = o((e) => {
e.unsubscribe();
import { createStore as s, is as x, attach as l, scopeBind as d, sample as c } from "effector";
function z({
source: t,
subscribeOn: n,
unsubscribeOn: u,
target: f
}) {
const r = s(null, {
serialize: "ignore"
}), a = x.store(t) ? t : s(t, { serialize: "ignore" }), o = l({
source: r,
effect: (e, g) => {
e == null || e.unsubscribe();
const m = d(f, { safe: !0 });
return g.subscribe(m);
}
}), b = l({
source: r,
effect: (e) => {
e == null || e.unsubscribe();
}
});
c({
clock: a,
clock: [n, a],
source: a,
target: o
}), c({
clock: o.doneData,
target: r
}), c({
clock: r.doneData,
target: t
}), c({
clock: n,
source: t,
filter: (e) => !!e,
target: l
clock: u,
source: r,
target: b
});
};
}
export {
p as rxSample
z as rxSample
};
{
"name": "rx-sample",
"version": "0.2.0",
"version": "0.2.1",
"type": "module",

@@ -5,0 +5,0 @@ "files": [

@@ -58,8 +58,15 @@ # rx-sample

```ts
type Input<D, S, U> = {
type Input<D> = {
source: Observable<D>;
subscribeOn: EventCallable<S>;
unsubscribeOn: EventCallable<U>;
target: EventCallable<D> | EventCallable<void>;
subscribeOn: Event<unknown>;
unsubscribeOn: Event<unknown>;
target: EventCallable<D>;
};
type InputWithStore<D> = {
source: Store<Observable<D>>;
subscribeOn: Event<unknown>;
unsubscribeOn: Event<unknown>;
target: EventCallable<D>;
};
```

@@ -66,0 +73,0 @@

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