New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hooks.macro

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hooks.macro - npm Package Compare versions

Comparing version 0.1.7 to 0.2.0

src/hooks.macro.d.ts

2

build/hooks.macro.js

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

var CONFIGS = [['useAutoMemo', 'useMemo', true], ['useAutoCallback', 'useCallback', false], ['useAutoEffect', 'useEffect', false], ['useAutoMutationEffect', 'useMutationEffect', false], ['useAutoLayoutEffect', 'useLayoutEffect', false]];
var CONFIGS = [['useAutoMemo', 'useMemo', true], ['useAutoCallback', 'useCallback', false], ['useAutoEffect', 'useEffect', false], ['useAutoLayoutEffect', 'useLayoutEffect', false]];

@@ -139,0 +139,0 @@ function memoMacro(_ref2) {

{
"name": "hooks.macro",
"version": "0.1.7",
"version": "0.2.0",
"author": "Pier Paolo Ramon <ramonpierre@gmail.com>",

@@ -8,7 +8,10 @@ "main": "build/hooks.macro.js",

"repository": "https://github.com/yuchi/hooks.macro.git",
"typings": "./index.d.ts",
"typings": "build/hooks.macro.d.ts",
"scripts": {
"test": "jest",
"test:update": "jest --updateSnapshot",
"build": "babel src/hooks.macro.js -d build",
"build": "yarn build:babel && yarn build:flow && yarn build:typescript",
"build:babel": "babel src/hooks.macro.js -d build",
"build:flow": "cp src/**.js.flow build",
"build:typescript": "cp src/**.d.ts build",
"format": "prettier --write \"**/*.ts\" \"**/*.json\" \"**/*.js\" \"**/*.md\""

@@ -15,0 +18,0 @@ },

@@ -25,3 +25,3 @@ # Hooks’ Macro :umbrella:

- [`useAutoCallback`](#useautocallback)
- [`useAutoEffect`, `useAutoMutationEffect`, `useAutoLayoutEffect`](#useautoeffect-useautomutationeffect-useautolayouteffect)
- [`useAutoEffect`, `useAutoLayoutEffect`](#useautoeffect-useautolayouteffect)
- [Limitations](#limitations)

@@ -160,3 +160,3 @@ - [Inspiration](#inspiration)

### `useAutoEffect`, `useAutoMutationEffect`, `useAutoLayoutEffect`
### `useAutoEffect`, `useAutoLayoutEffect`

@@ -166,7 +166,3 @@ They work exactly like their standard React counterpart, but they automatically identify value dependencies.

```js
import {
useAutoEffect,
useAutoMutationEffect,
useAutoLayoutEffect,
} from 'hooks.macro';
import { useAutoEffect, useAutoLayoutEffect } from 'hooks.macro';
```

@@ -173,0 +169,0 @@

@@ -177,3 +177,2 @@ const { addNamed } = require('@babel/helper-module-imports');

['useAutoEffect', 'useEffect', false],
['useAutoMutationEffect', 'useMutationEffect', false],
['useAutoLayoutEffect', 'useLayoutEffect', false],

@@ -180,0 +179,0 @@ ];

@@ -15,3 +15,2 @@ const path = require('path');

'useAutoLayoutEffect',
'useAutoLayoutEffect',
].map(macroName => ({

@@ -26,12 +25,8 @@ title: `Throws if not called as function (${macroName})`,

})),
...[
'useAutoCallback',
'useAutoEffect',
'useAutoLayoutEffect',
'useAutoLayoutEffect',
].map(macroName => ({
title: `Throws if not called with a function (${macroName})`,
error: true,
snapshot: false,
code: `
...['useAutoCallback', 'useAutoEffect', 'useAutoLayoutEffect'].map(
macroName => ({
title: `Throws if not called with a function (${macroName})`,
error: true,
snapshot: false,
code: `
import { ${macroName} } from './hooks.macro'

@@ -42,13 +37,10 @@ function FakeComponent() {

`,
})),
...[
'useAutoCallback',
'useAutoEffect',
'useAutoLayoutEffect',
'useAutoLayoutEffect',
].map(macroName => ({
title: `Throws if not called without arguments (${macroName})`,
error: true,
snapshot: false,
code: `
}),
),
...['useAutoCallback', 'useAutoEffect', 'useAutoLayoutEffect'].map(
macroName => ({
title: `Throws if called without arguments (${macroName})`,
error: true,
snapshot: false,
code: `
import { ${macroName} } from './hooks.macro'

@@ -59,3 +51,4 @@ function FakeComponent() {

`,
})),
}),
),
{

@@ -62,0 +55,0 @@ title: 'Works with null',

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