Skip to content

Commit 5c53627

Browse files
Changing default thresholds.
1 parent e8fc304 commit 5c53627

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ Vue.use(ConnectionAware);
3838
// Or specifying the different category thresholds.
3939
Vue.use(ConnectionAware, {
4040
connectionCategoryThreshold: {
41-
slow: 1,
42-
medium: 3
41+
slow: 2,
42+
medium: 6
4343
}
4444
});
4545
```
@@ -61,12 +61,12 @@ export default {
6161

6262
The default connection category thresholds, in Mbps, are:
6363
```
64-
slow: 2,
65-
medium: 6,
64+
slow: 1,
65+
medium: 2,
6666
fast: Number.MAX_SAFE_INTEGER
6767
```
6868

69-
This means that any download speed up to 2 Mbps, will be considered as `slow`. Any connection above 2 Mbps up to 6 Mbps will be considered as `medium`. Anything above that will be `fast`. You can override these defaults by specifying the defaults when installing the component as a plugin.
69+
This means that any download speed up to 1 Mbps, will be considered as `slow`. Any connection above 1 Mbps up to 2 Mbps will be considered as `medium`. Anything above that will be `fast`. You can override these defaults by specifying the defaults when installing the component as a plugin.
7070

7171
Each web application will have different requirements, and that's why you can configure the different thresholds.
7272

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-connection-aware",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"private": false,
55
"description": "A Vue component to easily create connection-aware web applications 📶",
66
"author": "Sacha Zvetelman",

src/plugins/ConnectionAware/ConnectionAware.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<script>
88
const DEFAULT_OPTIONS = {
99
connectionCategoryThreshold: {
10-
slow: 2,
11-
medium: 6,
10+
slow: 1,
11+
medium: 2,
1212
fast: Number.MAX_SAFE_INTEGER
1313
}
1414
};

tests/unit/ConnectionAware.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { shallowMount } from "@vue/test-utils";
22
import ConnectionAware from "@/plugins/ConnectionAware/ConnectionAware.vue";
33

4-
const slowSpeed = 1;
5-
const mediumSpeed = 5;
4+
const slowSpeed = 0.9;
5+
const mediumSpeed = 1.9;
66
const fastSpeed = 10;
77

88
describe("ConnectionAware.vue", () => {
@@ -107,7 +107,7 @@ describe("ConnectionAware.vue", () => {
107107
});
108108

109109
describe("getConnectionCategoryByDownloadSpeed", () => {
110-
it.each([[slowSpeed], [slowSpeed + 1]])(
110+
it.each([[slowSpeed], [slowSpeed + 0.1]])(
111111
"returns slow category when speed is within the slow category",
112112
speed => {
113113
// Arrange
@@ -121,7 +121,7 @@ describe("ConnectionAware.vue", () => {
121121
}
122122
);
123123

124-
it.each([[mediumSpeed], [mediumSpeed + 1]])(
124+
it.each([[mediumSpeed], [mediumSpeed + 0.1]])(
125125
"returns medium category when speed is within the medium category",
126126
speed => {
127127
// Arrange

0 commit comments

Comments
 (0)