Skip to content

Commit

Permalink
update lib name
Browse files Browse the repository at this point in the history
  • Loading branch information
tkostuch committed Oct 23, 2020
1 parent abc689b commit 93f800e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# instant-data-prefetch
# instant-prefetch

Extension of well known [InstantPage](https://instant.page/) library.
All kudos for (☞゚∀゚)☞ Alexandre Dieulot


```javascript
import { init } from 'instant-data-prefetch'
import { init } from 'instant-prefetch'

init(
(element) => {
// access to link url
console.log(element.href)
// We can also add data attributes to element and then retrive it here
// For example:
// <a data-instant-data-prefetch='{"url": "/women.html", "type": "category"}' >
// <a data-instant-prefetch='{"url": "/women.html", "type": "category"}' >
if ('instantDataPrefetch' in linkElement.dataset) {
try {
const data = JSON.parse(linkElement.dataset['instantDataPrefetch'])
Expand Down
2 changes: 1 addition & 1 deletion bili.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
output: {
dir: 'dist',
fileName: 'instant-data-prefetch.js',
fileName: 'instant-prefetch.js',
minify: true
}
}
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "instant-data-prefetch",
"name": "instant-prefetch",
"version": "1.0.0",
"description": "improves page loading for SPA apps",
"main": "dist/instant-data-prefetch.js",
"cdn": "dist/instant-data-prefetch.js",
"unpkg": "dist/instant-data-prefetch.js",
"main": "dist/instant-prefetch.js",
"cdn": "dist/instant-prefetch.js",
"unpkg": "dist/instant-prefetch.js",
"scripts": {
"test": "yarn test",
"lint": "eslint src",
Expand All @@ -15,14 +15,14 @@
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/gibkigonzo/instant-data-prefetch.git"
"url": "https://github.com/gibkigonzo/instant-prefetch.git"
},
"files": [
"dist"
],
"homepage": "https://github.com/gibkigonzo/instant-data-prefetch",
"homepage": "https://github.com/gibkigonzo/instant-prefetch",
"bugs": {
"url": "https://github.com/gibkigonzo/instant-data-prefetch/issues"
"url": "https://github.com/gibkigonzo/instant-prefetch/issues"
},
"devDependencies": {
"bili": "^5.0.5",
Expand Down

0 comments on commit 93f800e

Please sign in to comment.