1
Fork 0
mirror of https://github.com/Steffo99/bluelib.git synced 2024-12-22 19:44:21 +00:00
This commit is contained in:
Steffo 2020-06-19 22:10:06 +02:00
parent fe49e7d888
commit 4397eb18fb
Signed by: steffo
GPG key ID: 896A80F55F7C97F0
3 changed files with 51 additions and 5 deletions

44
package-lock.json generated
View file

@ -1,6 +1,6 @@
{ {
"name": "bluelib", "name": "bluelib",
"version": "0.8.2", "version": "0.11.2",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -1435,12 +1435,26 @@
"integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==",
"dev": true "dev": true
}, },
"@types/prop-types": {
"version": "15.7.3",
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.3.tgz",
"integrity": "sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw=="
},
"@types/q": { "@types/q": {
"version": "1.5.4", "version": "1.5.4",
"resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.4.tgz", "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.4.tgz",
"integrity": "sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug==", "integrity": "sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug==",
"dev": true "dev": true
}, },
"@types/react": {
"version": "16.9.38",
"resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.38.tgz",
"integrity": "sha512-pHAeZbjjNRa/hxyNuLrvbxhhnKyKNiLC6I5fRF2Zr/t/S6zS41MiyzH4+c+1I9vVfvuRt1VS2Lodjr4ZWnxrdA==",
"requires": {
"@types/prop-types": "*",
"csstype": "^2.2.0"
}
},
"@types/resolve": { "@types/resolve": {
"version": "0.0.8", "version": "0.0.8",
"resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-0.0.8.tgz", "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-0.0.8.tgz",
@ -1450,6 +1464,14 @@
"@types/node": "*" "@types/node": "*"
} }
}, },
"@types/use-deep-compare-effect": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/@types/use-deep-compare-effect/-/use-deep-compare-effect-1.2.0.tgz",
"integrity": "sha512-2uNqaSobMvUTGR7G72tUHDX+Kx341q25OuM0m2B6VID7eljIvYuDaFTKfmDnbvej67yEhCc35zA6dmIYriwOXA==",
"requires": {
"@types/react": "*"
}
},
"@webassemblyjs/ast": { "@webassemblyjs/ast": {
"version": "1.9.0", "version": "1.9.0",
"resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.9.0.tgz", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.9.0.tgz",
@ -3995,6 +4017,11 @@
"cssom": "0.3.x" "cssom": "0.3.x"
} }
}, },
"csstype": {
"version": "2.6.10",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.10.tgz",
"integrity": "sha512-D34BqZU4cIlMCY93rZHbrq9pjTAQJ3U8S8rfBqjwHxkGPThWFjzZDQpgMJY0QViLxth6ZKYiwFBo14RdN44U/w=="
},
"cyclist": { "cyclist": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz",
@ -4231,6 +4258,11 @@
"integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=",
"dev": true "dev": true
}, },
"dequal": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/dequal/-/dequal-1.0.0.tgz",
"integrity": "sha512-/Nd1EQbQbI9UbSHrMiKZjFLrXSnU328iQdZKPQf78XQI6C+gutkFUeoHpG5J08Ioa6HeRbRNFpSIclh1xyG0mw=="
},
"des.js": { "des.js": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz",
@ -12105,6 +12137,16 @@
"resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz",
"integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==" "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ=="
}, },
"use-deep-compare-effect": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/use-deep-compare-effect/-/use-deep-compare-effect-1.3.1.tgz",
"integrity": "sha512-ejL+Al+aeDyC9Sywx56ti4PtSwkf6BH27tEptMWF2cfO41/auG0nRRsArh6Vv5bUyBe3z7IyxmgQCK5nas70hg==",
"requires": {
"@babel/runtime": "^7.7.2",
"@types/use-deep-compare-effect": "^1.2.0",
"dequal": "^1.0.0"
}
},
"util": { "util": {
"version": "0.11.1", "version": "0.11.1",
"resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz",

View file

@ -1,13 +1,15 @@
{ {
"private": false, "private": false,
"name": "bluelib", "name": "bluelib",
"version": "0.11.2", "version": "0.11.3",
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"source": "src/index.js", "source": "src/index.js",
"main": "dist/index.js", "main": "dist/index.js",
"module": "dist/index.module.js", "module": "dist/index.module.js",
"unpkg": "dist/index.umd.js", "unpkg": "dist/index.umd.js",
"files": ["dist/*"], "files": [
"dist/*"
],
"scripts": { "scripts": {
"start": "preact watch", "start": "preact watch",
"dist": "git add . && cross-env-shell git commit -m \"$npm_package_version\" && git push && microbundle && npm publish && cross-env-shell hub release create -m \"$npm_package_version\" \"$npm_package_version\"" "dist": "git add . && cross-env-shell git commit -m \"$npm_package_version\" && git push && microbundle && npm publish && cross-env-shell hub release create -m \"$npm_package_version\" \"$npm_package_version\""
@ -33,6 +35,7 @@
"react-syntax-highlighter": "^12.2.1", "react-syntax-highlighter": "^12.2.1",
"showdown": "^1.9.1", "showdown": "^1.9.1",
"style-loader": "^1.2.1", "style-loader": "^1.2.1",
"use-deep-compare-effect": "^1.3.1",
"webpack": "^4.43.0" "webpack": "^4.43.0"
} }
} }

View file

@ -1,13 +1,14 @@
import RoyalnetInstanceUrl from '../contexts/RoyalnetInstanceUrl'; import RoyalnetInstanceUrl from '../contexts/RoyalnetInstanceUrl';
import {useContext, useEffect, useState} from 'preact/hooks'; import {useContext, useState} from 'preact/hooks';
import {royalnetApiRequest} from '../utils/royalnetApiRequest'; import {royalnetApiRequest} from '../utils/royalnetApiRequest';
import useDeepCompareEffect from "use-deep-compare-effect";
export default function(method, path, body) { export default function(method, path, body) {
const instanceUrl = useContext(RoyalnetInstanceUrl); const instanceUrl = useContext(RoyalnetInstanceUrl);
const [data, setData] = useState(undefined); const [data, setData] = useState(undefined);
useEffect(() => { useDeepCompareEffect(() => {
royalnetApiRequest(instanceUrl, method, path, body).then(d => setData(d)); royalnetApiRequest(instanceUrl, method, path, body).then(d => setData(d));
}, [instanceUrl, method, path, body]); }, [instanceUrl, method, path, body]);