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

@reonomy/reactive-hooks

Package Overview
Dependencies
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@reonomy/reactive-hooks - npm Package Compare versions

Comparing version 1.1.4 to 1.2.0

7

lib/use-mount-effect.d.ts

@@ -0,1 +1,4 @@

export interface Disposable {
(): (() => void) | void;
}
/**

@@ -5,5 +8,5 @@ * `useMountEffect`

* Handles component onMount() in the render function.
* @param {VoidFunction} onMountCallback - this function will be called only once when the component is mounted.
* @param {Disposable} onMountCallback - this function will be called only once when the component is mounted.
*/
export declare function useMountEffect(onMountCallback: VoidFunction): void;
export declare function useMountEffect(onMountCallback: Disposable): void;
export default useMountEffect;

@@ -8,12 +8,6 @@ "use strict";

* Handles component onMount() in the render function.
* @param {VoidFunction} onMountCallback - this function will be called only once when the component is mounted.
* @param {Disposable} onMountCallback - this function will be called only once when the component is mounted.
*/
function useMountEffect(onMountCallback) {
var _a = react_1.useState(false), wasMounted = _a[0], setMounted = _a[1];
react_1.useEffect(function () {
if (!wasMounted) {
setMounted(true);
onMountCallback();
}
});
react_1.useEffect(function () { return onMountCallback(); }, []);
}

@@ -20,0 +14,0 @@ exports.useMountEffect = useMountEffect;

@@ -20,3 +20,2 @@ "use strict";

function useRxAjax(api$, next) {
var a = '';
var req$ = react_1.useState(function () { return new Subject_1.Subject(); })[0];

@@ -23,0 +22,0 @@ var res$ = react_1.useMemo(function () { return req$.pipe(http_1.http(api$)); }, [req$]);

{
"name": "@reonomy/reactive-hooks",
"version": "1.1.4",
"version": "1.2.0",
"description": "RxJS React Hooks Library",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

Sorry, the diff of this file is not supported yet

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