vaniy 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -0
- package/dist/vaniy.es.js +240 -196
- package/dist/vaniy.es.js.map +1 -1
- package/dist/vaniy.umd.js +1 -1
- package/dist/vaniy.umd.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -123,6 +123,29 @@ const data = await HTTP.get("/data", {
|
|
|
123
123
|
},
|
|
124
124
|
});
|
|
125
125
|
|
|
126
|
+
**Shorthand codes:**
|
|
127
|
+
|
|
128
|
+
| Rule | Description |
|
|
129
|
+
| ---------- | ------------------------------- |
|
|
130
|
+
| `CFL` | cache-first + localStorage |
|
|
131
|
+
| `CFS` | cache-first + sessionStorage |
|
|
132
|
+
| `CFM` | cache-first + memory |
|
|
133
|
+
| `NFL` | network-first + localStorage |
|
|
134
|
+
| `NFS` | network-first + sessionStorage |
|
|
135
|
+
| `NFM` | network-first + memory |
|
|
136
|
+
|
|
137
|
+
// Or with cache helper see table below for options
|
|
138
|
+
const data = await HTTP.get("/data", cache("CFL 1min"));
|
|
139
|
+
|
|
140
|
+
// This will default to CFL
|
|
141
|
+
const data = await HTTP.get("/data", cache("1min"));
|
|
142
|
+
|
|
143
|
+
// This will default to CFL 1min
|
|
144
|
+
const data = await HTTP.get("/data", cache(""));
|
|
145
|
+
|
|
146
|
+
// This will also default to CFL 1min
|
|
147
|
+
const data = await HTTP.get("/data", cache());
|
|
148
|
+
|
|
126
149
|
// File upload with progress
|
|
127
150
|
await HTTP.upload("/upload", fileInput.files[0], {
|
|
128
151
|
onProgress: (sent, total, percent) => {
|