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

rxjs-hooks

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rxjs-hooks - npm Package Compare versions

Comparing version 0.4.2 to 0.4.3

5

dist/cjs/use-event-callback.d.ts
import { Observable, BehaviorSubject } from 'rxjs';
import { RestrictArray, Not } from './type';
declare type VoidableCallback<EventValue> = [EventValue] extends [void] ? () => void : (val: EventValue) => void;
declare type IfAny<T, Y, N> = 0 extends (1 & T) ? Y : N;
declare type IsAny<T> = IfAny<T, true, false>;
declare type IsVoid<T> = IsAny<T> extends true ? false : [T] extends [void] ? true : false;
declare type VoidableCallback<EventValue> = IsVoid<EventValue> extends true ? () => void : (val: EventValue) => void;
export declare type EventCallbackState<EventValue, State, Inputs = void> = [VoidableCallback<EventValue>, [State extends void ? null : State, BehaviorSubject<State | null>, BehaviorSubject<RestrictArray<Inputs> | null>]];

@@ -5,0 +8,0 @@ export declare type ReturnedState<EventValue, State, Inputs> = [EventCallbackState<EventValue, State, Inputs>[0], EventCallbackState<EventValue, State, Inputs>[1][0]];

import { Observable, BehaviorSubject } from 'rxjs';
import { RestrictArray, Not } from './type';
declare type VoidableCallback<EventValue> = [EventValue] extends [void] ? () => void : (val: EventValue) => void;
declare type IfAny<T, Y, N> = 0 extends (1 & T) ? Y : N;
declare type IsAny<T> = IfAny<T, true, false>;
declare type IsVoid<T> = IsAny<T> extends true ? false : [T] extends [void] ? true : false;
declare type VoidableCallback<EventValue> = IsVoid<EventValue> extends true ? () => void : (val: EventValue) => void;
export declare type EventCallbackState<EventValue, State, Inputs = void> = [VoidableCallback<EventValue>, [State extends void ? null : State, BehaviorSubject<State | null>, BehaviorSubject<RestrictArray<Inputs> | null>]];

@@ -5,0 +8,0 @@ export declare type ReturnedState<EventValue, State, Inputs> = [EventCallbackState<EventValue, State, Inputs>[0], EventCallbackState<EventValue, State, Inputs>[1][0]];

2

package.json
{
"name": "rxjs-hooks",
"version": "0.4.2",
"version": "0.4.3",
"description": "React hooks for RxJS",

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

@@ -6,4 +6,11 @@ import { useEffect, useState } from 'react'

type VoidableCallback<EventValue> = [EventValue] extends [void] ? () => void : (val: EventValue) => void
// https://stackoverflow.com/questions/55541275/typescript-check-for-the-any-type
type IfAny<T, Y, N> = 0 extends (1 & T) ? Y : N
type IsAny<T> = IfAny<T, true, false>
type IsVoid<T> = IsAny<T> extends true ? false : [T] extends [void] ? true : false
type VoidableCallback<EventValue> = IsVoid<EventValue> extends true ? () => void : (val: EventValue) => void
export type EventCallbackState<EventValue, State, Inputs = void> = [

@@ -10,0 +17,0 @@ VoidableCallback<EventValue>,

Sorry, the diff of this file is not supported yet

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