🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@rc-component/form

Package Overview
Dependencies
Maintainers
5
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rc-component/form - npm Package Compare versions

Comparing version
1.7.1
to
1.7.2
+4
-0
es/hooks/useNotifyWatch.d.ts
import type { InternalNamePath, WatchCallBack } from '../interface';
import type { FormStore } from './useForm';
/**
* Call action with delay in macro task.
*/
export declare const macroTask: (fn: VoidFunction) => void;
export default class WatcherCenter {

@@ -4,0 +8,0 @@ namePathList: InternalNamePath[];

+1
-1

@@ -5,3 +5,3 @@ import { matchNamePath } from "../utils/valueUtil";

*/
const macroTask = fn => {
export const macroTask = fn => {
const channel = new MessageChannel();

@@ -8,0 +8,0 @@ channel.port1.onmessage = fn;

@@ -0,8 +1,11 @@

import { macroTask } from "../hooks/useNotifyWatch";
import raf from "@rc-component/util/es/raf";
export default async function delayFrame() {
return new Promise(resolve => {
raf(() => {
resolve();
macroTask(() => {
raf(() => {
resolve();
});
});
});
}
import type { InternalNamePath, WatchCallBack } from '../interface';
import type { FormStore } from './useForm';
/**
* Call action with delay in macro task.
*/
export declare const macroTask: (fn: VoidFunction) => void;
export default class WatcherCenter {

@@ -4,0 +8,0 @@ namePathList: InternalNamePath[];

@@ -6,3 +6,3 @@ "use strict";

});
exports.default = void 0;
exports.macroTask = exports.default = void 0;
var _valueUtil = require("../utils/valueUtil");

@@ -17,2 +17,3 @@ /**

};
exports.macroTask = macroTask;
class WatcherCenter {

@@ -19,0 +20,0 @@ namePathList = [];

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

exports.default = delayFrame;
var _useNotifyWatch = require("../hooks/useNotifyWatch");
var _raf = _interopRequireDefault(require("@rc-component/util/lib/raf"));

@@ -12,6 +13,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

return new Promise(resolve => {
(0, _raf.default)(() => {
resolve();
(0, _useNotifyWatch.macroTask)(() => {
(0, _raf.default)(() => {
resolve();
});
});
});
}
{
"name": "@rc-component/form",
"version": "1.7.1",
"version": "1.7.2",
"description": "React Form Component",

@@ -5,0 +5,0 @@ "typings": "es/index.d.ts",