Socket
Socket
Sign inDemoInstall

@tamagui/use-event

Package Overview
Dependencies
Maintainers
0
Versions
940
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tamagui/use-event - npm Package Compare versions

Comparing version 1.107.0 to 1.108.0-1722728147390

18

dist/cjs/useGet.js

@@ -0,5 +1,6 @@

var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {

@@ -14,3 +15,10 @@ for (var name in all)

};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
mod
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
var useGet_exports = {};

@@ -21,8 +29,8 @@ __export(useGet_exports, {

module.exports = __toCommonJS(useGet_exports);
var import_constants = require("@tamagui/constants"), import_react = require("react");
var import_constants = require("@tamagui/constants"), React = __toESM(require("react"));
function useGet(currentValue, initialValue, forwardToFunction) {
const curRef = (0, import_react.useRef)(initialValue ?? currentValue);
const curRef = React.useRef(initialValue ?? currentValue);
return (0, import_constants.useIsomorphicLayoutEffect)(() => {
curRef.current = currentValue;
}), (0, import_react.useCallback)(
}), React.useCallback(
forwardToFunction ? (...args) => curRef.current?.apply(null, args) : () => curRef.current,

@@ -29,0 +37,0 @@ []

"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {

@@ -15,3 +16,10 @@ for (var name in all)

};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
mod
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
var useGet_exports = {};

@@ -22,8 +30,8 @@ __export(useGet_exports, {

module.exports = __toCommonJS(useGet_exports);
var import_constants = require("@tamagui/constants"), import_react = require("react");
var import_constants = require("@tamagui/constants"), React = __toESM(require("react"));
function useGet(currentValue, initialValue, forwardToFunction) {
var curRef = (0, import_react.useRef)(initialValue ?? currentValue);
var curRef = React.useRef(initialValue ?? currentValue);
return (0, import_constants.useIsomorphicLayoutEffect)(function() {
curRef.current = currentValue;
}), (0, import_react.useCallback)(forwardToFunction ? function() {
}), React.useCallback(forwardToFunction ? function() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)

@@ -30,0 +38,0 @@ args[_key] = arguments[_key];

import { useIsomorphicLayoutEffect } from "@tamagui/constants";
import { useCallback, useRef } from "react";
import * as React from "react";
function useGet(currentValue, initialValue, forwardToFunction) {
const curRef = useRef(initialValue ?? currentValue);
const curRef = React.useRef(initialValue ?? currentValue);
return useIsomorphicLayoutEffect(() => {
curRef.current = currentValue;
}), useCallback(
}), React.useCallback(
forwardToFunction ? (...args) => curRef.current?.apply(null, args) : () => curRef.current,

@@ -9,0 +9,0 @@ []

import { useIsomorphicLayoutEffect } from "@tamagui/constants";
import { useCallback, useRef } from "react";
import * as React from "react";
function useGet(currentValue, initialValue, forwardToFunction) {
var curRef = useRef(initialValue ?? currentValue);
var curRef = React.useRef(initialValue ?? currentValue);
return useIsomorphicLayoutEffect(function() {
curRef.current = currentValue;
}), useCallback(forwardToFunction ? function() {
}), React.useCallback(forwardToFunction ? function() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)

@@ -9,0 +9,0 @@ args[_key] = arguments[_key];

{
"name": "@tamagui/use-event",
"version": "1.107.0",
"version": "1.108.0-1722728147390",
"types": "./types/index.d.ts",

@@ -21,7 +21,7 @@ "main": "dist/cjs",

"devDependencies": {
"@tamagui/build": "1.107.0",
"@tamagui/build": "1.108.0-1722728147390",
"react": "^18.2.0 || ^19.0.0"
},
"dependencies": {
"@tamagui/constants": "1.107.0"
"@tamagui/constants": "1.108.0-1722728147390"
},

@@ -28,0 +28,0 @@ "exports": {

import { useIsomorphicLayoutEffect } from '@tamagui/constants'
import { useCallback, useRef } from 'react'
import * as React from 'react'

@@ -11,3 +11,3 @@ // keeps a reference to the current value easily

): () => A {
const curRef = useRef<any>(initialValue ?? currentValue)
const curRef = React.useRef<any>(initialValue ?? currentValue)
useIsomorphicLayoutEffect(() => {

@@ -17,3 +17,3 @@ curRef.current = currentValue

return useCallback(
return React.useCallback(
forwardToFunction

@@ -20,0 +20,0 @@ ? (...args) => curRef.current?.apply(null, args)

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

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