react-lazy-data
Advanced tools
Comparing version 0.1.4 to 0.1.5
# Changelog | ||
## 0.1.5 | ||
Bug fixes: | ||
* ESM export production/dev build depending on `NODE_ENV` | ||
Dependencies: | ||
* Update `is-class-component` dependency | ||
Dev: | ||
* Update dev dependencies | ||
* Remove `npm-debug.log` from `.gitignore` | ||
* Tab width 2 in `.editorconfig` | ||
* Jest config code comment [nocode] | ||
Docs: | ||
* README examples tweak | ||
## 0.1.4 | ||
@@ -4,0 +25,0 @@ |
/* -------------------- | ||
* react-lazy-data module | ||
* ESM Entry point | ||
* Re-export in tree-shakable form, choosing dev or prod build based on NODE_ENV. | ||
* ------------------*/ | ||
// Imports | ||
import { | ||
createResourceFactory as createResourceFactoryProd, | ||
isResource as isResourceProd, | ||
withResources as withResourcesProd | ||
} from '../dist/esm/react-lazy-data.min.js'; | ||
import { | ||
createResourceFactory as createResourceFactoryDev, | ||
isResource as isResourceDev, | ||
withResources as withResourcesDev | ||
} from '../dist/esm/react-lazy-data.js'; | ||
// Exports | ||
export * from '../dist/esm/react-lazy-data.js'; | ||
export const createResourceFactory = process.env.NODE_ENV === 'production' ? createResourceFactoryProd : createResourceFactoryDev; | ||
export const isResource = process.env.NODE_ENV === 'production' ? isResourceProd : isResourceDev; | ||
export const withResources = process.env.NODE_ENV === 'production' ? withResourcesProd : withResourcesDev; |
/* -------------------- | ||
* react-lazy-data module | ||
* CJS entry point | ||
* Export dev or prod build based on NODE_ENV. | ||
* ------------------*/ | ||
@@ -5,0 +6,0 @@ |
{ | ||
"name": "react-lazy-data", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "Lazy-load data with React Suspense", | ||
@@ -27,3 +27,3 @@ "main": "index.js", | ||
"@babel/runtime": "^7.9.2", | ||
"is-class-component": "^1.0.1", | ||
"is-class-component": "^1.1.1", | ||
"is-it-type": "^3.1.1", | ||
@@ -42,6 +42,6 @@ "is-promise": "^2.1.0", | ||
"@babel/preset-react": "^7.9.4", | ||
"@overlookmotel/eslint-config": "^6.0.1", | ||
"@overlookmotel/eslint-config-jest": "^3.0.1", | ||
"@overlookmotel/eslint-config-node": "^1.0.2", | ||
"@overlookmotel/eslint-config-react": "^6.0.0", | ||
"@overlookmotel/eslint-config": "^7.1.2", | ||
"@overlookmotel/eslint-config-jest": "^4.0.1", | ||
"@overlookmotel/eslint-config-node": "^2.0.0", | ||
"@overlookmotel/eslint-config-react": "^7.0.0", | ||
"@rollup/plugin-commonjs": "^11.0.2", | ||
@@ -64,3 +64,3 @@ "@rollup/plugin-node-resolve": "^7.1.1", | ||
"eslint-plugin-react": "^7.19.0", | ||
"eslint-plugin-react-hooks": "^1.7.0", | ||
"eslint-plugin-react-hooks": "^2.5.1", | ||
"jest": "^25.2.7", | ||
@@ -67,0 +67,0 @@ "jest-extended": "^0.11.5", |
@@ -37,3 +37,3 @@ [![NPM version](https://img.shields.io/npm/v/react-lazy-data.svg)](https://www.npmjs.com/package/react-lazy-data) | ||
id => | ||
fetch(`https://pokeapi.co/api/v2/pokemon/${id}/`) | ||
fetch(`https://pokeapi.co/api/v2/pokemon/${id}`) | ||
.then(res => res.json()) | ||
@@ -79,3 +79,3 @@ ); | ||
id => | ||
fetch(`https://pokeapi.co/api/v2/pokemon/${id}/`) | ||
fetch(`https://pokeapi.co/api/v2/pokemon/${id}`) | ||
.then(res => res.json()) | ||
@@ -134,3 +134,3 @@ ); | ||
id => | ||
fetch(`https://pokeapi.co/api/v2/pokemon/${id}/`) | ||
fetch(`https://pokeapi.co/api/v2/pokemon/${id}`) | ||
.then(res => res.json()) | ||
@@ -225,3 +225,3 @@ ); | ||
const PokemonResource = createResourceFactory( | ||
id => abortableFetchJson(`https://pokeapi.co/api/v2/pokemon/${id}/`) | ||
id => abortableFetchJson(`https://pokeapi.co/api/v2/pokemon/${id}`) | ||
); | ||
@@ -242,3 +242,3 @@ | ||
const PokemonResource = createResourceFactory( | ||
id => abortableFetchJson(`https://pokeapi.co/api/v2/pokemon/${id}/`) | ||
id => abortableFetchJson(`https://pokeapi.co/api/v2/pokemon/${id}`) | ||
); | ||
@@ -284,3 +284,3 @@ | ||
const Resource = createResourceFactory( | ||
id => fetch(`https://pokeapi.co/api/v2/pokemon/${id}/`).then(res => res.json()), | ||
id => fetch(`https://pokeapi.co/api/v2/pokemon/${id}`).then(res => res.json()), | ||
{ serialize: true } | ||
@@ -287,0 +287,0 @@ ); |
187546
1082
4
Updatedis-class-component@^1.1.1