🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

ffw-react

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ffw-react - npm Package Compare versions

Comparing version
1.1.2
to
1.1.3
+70
./dist/ffw-react.js
import { createContext as b, useContext as v, useMemo as d, useCallback as c, useSyncExternalStore as F } from "react";
const l = b(null), y = l.Provider, x = () => v(l);
function i(t) {
const e = x();
return t || e;
}
function f(t, e) {
const r = d(
() => ({
immutable: {
value: t()
}
}),
[t, e]
), n = c(
(u) => e((o) => {
r.immutable = { ...r.immutable }, r.immutable.value = o, u(o);
}),
[t, e]
);
return F(
n,
() => r.immutable,
() => r.immutable
).value;
}
function S(t) {
const e = i(t), r = c(
(u) => e.on("valid", u),
[e]
), n = c(() => e.getValid(), [e]);
return f(n, r);
}
function C(t) {
const e = t;
e.react = {
getFieldHelpers: () => ({
value: t.value,
onInput: (r) => t.set(r.target.value),
onBlur: () => t.onBlur()
})
};
}
const E = () => (t) => {
const e = t.createField;
t.createField = function(...r) {
const n = e.apply(t, r);
return C(n), n;
};
};
function p(t, e) {
return t = typeof t == "function" ? t(e) : t, t.map((n) => typeof n == "string" ? e.fields[n] : n);
}
function P(t = [], e) {
const r = i(e), n = p(t, r), s = c(() => n, n), u = c((o) => (n.forEach(
(a) => a.on("*", () => {
o(n);
})
), () => {
n.forEach((a) => a.off("*", o));
}), n);
return f(s, u);
}
export {
y as FfwProvider,
E as addReactPlugin,
P as useFields,
i as useForm,
S as useFormValid
};
+3
-5
{
"name": "ffw-react",
"version": "1.1.2",
"version": "1.1.3",
"description": "",
"type": "module",
"exports": {
"import": "./dist/ffw-react.js",
"require": "./dist/ffw-react.cjs"
},
"types": "./dist/types/ffw-react.d.ts",
"main": "./dist/ffw-react.js",
"files": [

@@ -11,0 +9,0 @@ "dist/**/*"