hooks.macro
Advanced tools
Comparing version 0.1.7 to 0.2.0
@@ -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', |
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
63998
13
0
877
212