5htp-core 0.4.4-4 → 0.4.4-5

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "5htp-core",
3
3
  "description": "Convenient TypeScript framework designed for Performance and Productivity.",
4
- "version": "0.4.4-4",
4
+ "version": "0.4.4-5",
5
5
  "author": "Gaetan Le Gac (https://github.com/gaetanlegac)",
6
6
  "repository": "git://github.com/gaetanlegac/5htp-core.git",
7
7
  "license": "MIT",
@@ -74,7 +74,7 @@ export default ({
74
74
  if (refCommit.current !== null)
75
75
  clearTimeout(refCommit.current);
76
76
 
77
- refCommit.current = setTimeout(commitValue, 500);
77
+ refCommit.current = setTimeout(commitValue, 100);
78
78
 
79
79
  }, [value]);
80
80
 
@@ -96,6 +96,10 @@ export default ({ service: clientRouter }: { service?: ClientRouter }) => {
96
96
 
97
97
  // Set loading state
98
98
  clientRouter.runHook('page.change', request);
99
+ window.scrollTo({
100
+ top: 0,
101
+ behavior: 'smooth'
102
+ });
99
103
  clientRouter.setLoading(true);
100
104
  const newpage = context.page = await clientRouter.resolve(request);
101
105
 
@@ -27,7 +27,6 @@ export default class ClientRequest<TRouter extends ClientRouter = ClientRouter>
27
27
  public api: ApiClient;
28
28
  public response?: ClientResponse<TRouter>;
29
29
 
30
- public url: string;
31
30
  public hash?: string;
32
31
 
33
32
  public constructor(
@@ -17,6 +17,7 @@ export default abstract class BaseRequest {
17
17
 
18
18
  // Permet d'accèder à l'instance complète via spread
19
19
  public request: this = this;
20
+ public url!: string;
20
21
  public host!: string;
21
22
 
22
23
  public data: TObjetDonnees = {};
@@ -87,6 +87,7 @@ export default class ServerRequest<
87
87
  this.router = router;
88
88
  this.api = new ApiClient(this);
89
89
 
90
+ this.url = this.req.url;
90
91
  this.host = this.req.get('host') as string;
91
92
  this.method = method;
92
93
  this.headers = headers || {};