@cfcs/react
Advanced tools
Comparing version 0.0.15-beta.1 to 0.0.15-beta.2
@@ -7,3 +7,3 @@ /* | ||
repository: https://github.com/naver/cfcs | ||
version: 0.0.15-beta.0 | ||
version: 0.0.15-beta.2 | ||
*/ | ||
@@ -71,8 +71,13 @@ 'use strict'; | ||
// eslint-disable-next-line react-hooks/rules-of-hooks | ||
var listener = react.useMemo(function () { | ||
adaptResult.on(name, callback); | ||
return callback; | ||
}, dependencies); | ||
react.useEffect(function () { | ||
adaptResult.on(name, callback); | ||
adaptResult.off(name, listener); | ||
adaptResult.on(name, listener); | ||
return function () { | ||
adaptResult.off(name, callback); | ||
adaptResult.off(name, listener); | ||
}; // eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, dependencies); | ||
}, [listener]); | ||
}; | ||
@@ -79,0 +84,0 @@ }); |
@@ -7,3 +7,3 @@ /* | ||
repository: https://github.com/naver/cfcs | ||
version: 0.0.15-beta.0 | ||
version: 0.0.15-beta.2 | ||
*/ | ||
@@ -69,8 +69,13 @@ import { adaptReactive, keys, camelize } from '@cfcs/core'; | ||
// eslint-disable-next-line react-hooks/rules-of-hooks | ||
var listener = useMemo(function () { | ||
adaptResult.on(name, callback); | ||
return callback; | ||
}, dependencies); | ||
useEffect(function () { | ||
adaptResult.on(name, callback); | ||
adaptResult.off(name, listener); | ||
adaptResult.on(name, listener); | ||
return function () { | ||
adaptResult.off(name, callback); | ||
adaptResult.off(name, listener); | ||
}; // eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, dependencies); | ||
}, [listener]); | ||
}; | ||
@@ -77,0 +82,0 @@ }); |
{ | ||
"name": "@cfcs/react", | ||
"version": "0.0.15-beta.1", | ||
"version": "0.0.15-beta.2", | ||
"description": "Cross Framework Components", | ||
@@ -35,3 +35,3 @@ "main": "dist/cfcs.cjs.js", | ||
"dependencies": { | ||
"@cfcs/core": "0.0.15-beta.1" | ||
"@cfcs/core": "0.0.15-beta.2" | ||
}, | ||
@@ -38,0 +38,0 @@ "devDependencies": { |
@@ -71,9 +71,16 @@ import { ReactiveSubscribe, ReactiveAdapter, keys, camelize, adaptReactive } from "@cfcs/core"; | ||
// eslint-disable-next-line react-hooks/rules-of-hooks | ||
const listener = useMemo(() => { | ||
adaptResult.on(name as any, callback as any); | ||
return callback; | ||
}, dependencies); | ||
useEffect(() => { | ||
adaptResult.on(name as any, callback as any); | ||
adaptResult.off(name as any, listener as any); | ||
adaptResult.on(name as any, listener as any); | ||
return () => { | ||
adaptResult.off(name as any, callback as any); | ||
adaptResult.off(name as any, listener as any); | ||
}; | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, dependencies); | ||
}, [listener]); | ||
}; | ||
@@ -80,0 +87,0 @@ }); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24817
352
+ Added@cfcs/core@0.0.15-beta.2(transitive)
- Removed@cfcs/core@0.0.15-beta.1(transitive)
Updated@cfcs/core@0.0.15-beta.2