@cfcs/react
Advanced tools
Comparing version 0.0.14 to 0.0.15-beta.0
import { ReactiveSubscribe, ReactiveAdapter } from "@cfcs/core"; | ||
import { ReactReactiveResult } from "./types"; | ||
export declare function useReactive<Instance extends ReactiveSubscribe<Record<string, any>>, State extends Record<string, any> = {}, Methods extends keyof Partial<Instance> = any, Data = any, Events extends Record<string, any> = {}>(reactiveProps: ReactiveAdapter<Instance, State, Methods, Data, Events>): ReactReactiveResult<Instance, State, Methods, Events>; | ||
export declare function useReactive<Instance extends ReactiveSubscribe<Record<string, any>>, State extends Record<string, any> = {}, Methods extends keyof Partial<Instance> = any, Props = any, Events extends Record<string, any> = {}>(reactiveAdapter: ReactiveAdapter<Instance, State, Methods, Props, Events>): ReactReactiveResult<Instance, State, Methods, Events>; |
@@ -7,3 +7,3 @@ /* | ||
repository: https://github.com/naver/cfcs | ||
version: 0.0.14 | ||
version: 0.0.15-beta.0 | ||
*/ | ||
@@ -15,5 +15,5 @@ 'use strict'; | ||
function useReactive(reactiveProps) { | ||
function useReactive(reactiveAdapter) { | ||
var adaptResult = react.useMemo(function () { | ||
return core.adaptReactive(reactiveProps); | ||
return core.adaptReactive(reactiveAdapter); | ||
}, []); | ||
@@ -68,3 +68,3 @@ var reactiveState = adaptResult.state(); | ||
}, {}); | ||
var reactiveEvents = reactiveProps.events || []; | ||
var reactiveEvents = reactiveAdapter.events || []; | ||
reactiveEvents.forEach(function (name) { | ||
@@ -71,0 +71,0 @@ result[core.camelize("on ".concat(name))] = function (callback, dependencies) { |
@@ -7,3 +7,3 @@ /* | ||
repository: https://github.com/naver/cfcs | ||
version: 0.0.14 | ||
version: 0.0.15-beta.0 | ||
*/ | ||
@@ -13,5 +13,5 @@ import { adaptReactive, keys, camelize } from '@cfcs/core'; | ||
function useReactive(reactiveProps) { | ||
function useReactive(reactiveAdapter) { | ||
var adaptResult = useMemo(function () { | ||
return adaptReactive(reactiveProps); | ||
return adaptReactive(reactiveAdapter); | ||
}, []); | ||
@@ -66,3 +66,3 @@ var reactiveState = adaptResult.state(); | ||
}, {}); | ||
var reactiveEvents = reactiveProps.events || []; | ||
var reactiveEvents = reactiveAdapter.events || []; | ||
reactiveEvents.forEach(function (name) { | ||
@@ -69,0 +69,0 @@ result[camelize("on ".concat(name))] = function (callback, dependencies) { |
{ | ||
"name": "@cfcs/react", | ||
"version": "0.0.14", | ||
"version": "0.0.15-beta.0", | ||
"description": "Cross Framework Components", | ||
@@ -35,3 +35,3 @@ "main": "dist/cfcs.cjs.js", | ||
"dependencies": { | ||
"@cfcs/core": "~0.0.14" | ||
"@cfcs/core": "0.0.15-beta.0" | ||
}, | ||
@@ -38,0 +38,0 @@ "devDependencies": { |
@@ -10,6 +10,6 @@ import { ReactiveSubscribe, ReactiveAdapter, keys, camelize, adaptReactive } from "@cfcs/core"; | ||
Methods extends keyof Partial<Instance> = any, | ||
Data = any, | ||
Props = any, | ||
Events extends Record<string, any> = {}, | ||
>(reactiveProps: ReactiveAdapter<Instance, State, Methods, Data, Events>): ReactReactiveResult<Instance, State, Methods, Events> { | ||
const adaptResult = useMemo(() => adaptReactive(reactiveProps), []); | ||
>(reactiveAdapter: ReactiveAdapter<Instance, State, Methods, Props, Events>): ReactReactiveResult<Instance, State, Methods, Events> { | ||
const adaptResult = useMemo(() => adaptReactive(reactiveAdapter), []); | ||
const reactiveState = adaptResult.state(); | ||
@@ -67,3 +67,3 @@ const names = keys<Record<string, any>>(reactiveState); | ||
const reactiveEvents = (reactiveProps.events || []); | ||
const reactiveEvents = (reactiveAdapter.events || []); | ||
@@ -70,0 +70,0 @@ reactiveEvents.forEach(name => { |
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
23344
+ Added@cfcs/core@0.0.15-beta.0(transitive)
- Removed@cfcs/core@0.0.26(transitive)
Updated@cfcs/core@0.0.15-beta.0