@@ -9,36 +9,36 @@ public class SessionStorage : IStorage
9
9
{
10
10
private readonly IJSRuntime runtime ;
11
11
12
- public Task < int > Length ( ) => this . runtime . InvokeAsync < int > ( MethodNames . LENGTH_METHOD , StorageTypeNames . SESSION_STORAGE ) ;
12
+ public ValueTask < int > Length ( ) => this . runtime . InvokeAsync < int > ( MethodNames . LENGTH_METHOD , StorageTypeNames . SESSION_STORAGE ) ;
13
13
14
- public Task Clear ( ) => this . runtime . InvokeAsync < object > ( MethodNames . CLEAR_METHOD , StorageTypeNames . SESSION_STORAGE ) ;
14
+ public ValueTask Clear ( ) => this . runtime . InvokeVoidAsync ( MethodNames . CLEAR_METHOD , StorageTypeNames . SESSION_STORAGE ) ;
15
15
16
16
public SessionStorage ( IJSRuntime runtime )
17
17
{
18
18
this . runtime = runtime ;
19
19
}
20
20
21
- public Task < TItem > GetItem < TItem > ( string key )
21
+ public ValueTask < TItem > GetItem < TItem > ( string key )
22
22
{
23
23
if ( string . IsNullOrWhiteSpace ( key ) ) throw new ArgumentNullException ( nameof ( key ) ) ;
24
24
25
25
return this . runtime . InvokeAsync < TItem > ( MethodNames . GET_ITEM_METHOD , StorageTypeNames . SESSION_STORAGE , key ) ;
26
26
}
27
27
28
- public Task < string > Key ( int index ) => this . runtime . InvokeAsync < string > ( MethodNames . KEY_METHOD , StorageTypeNames . SESSION_STORAGE , index ) ;
28
+ public ValueTask < string > Key ( int index ) => this . runtime . InvokeAsync < string > ( MethodNames . KEY_METHOD , StorageTypeNames . SESSION_STORAGE , index ) ;
29
29
30
- public Task RemoveItem ( string key )
30
+ public ValueTask RemoveItem ( string key )
31
31
{
32
32
if ( string . IsNullOrWhiteSpace ( key ) ) throw new ArgumentNullException ( nameof ( key ) ) ;
33
33
34
- return this . runtime . InvokeAsync < object > ( MethodNames . REMOVE_ITEM_METHOD , StorageTypeNames . SESSION_STORAGE , key ) ;
34
+ return this . runtime . InvokeVoidAsync ( MethodNames . REMOVE_ITEM_METHOD , StorageTypeNames . SESSION_STORAGE , key ) ;
35
35
}
36
36
37
- public Task SetItem < TItem > ( string key , TItem item )
37
+ public ValueTask SetItem < TItem > ( string key , TItem item )
38
38
{
39
39
if ( string . IsNullOrWhiteSpace ( key ) ) throw new ArgumentNullException ( nameof ( key ) ) ;
40
40
41
- return this . runtime . InvokeAsync < TItem > ( MethodNames . SET_ITEM_METHOD , StorageTypeNames . SESSION_STORAGE , key , item ) ;
41
+ return this . runtime . InvokeVoidAsync ( MethodNames . SET_ITEM_METHOD , StorageTypeNames . SESSION_STORAGE , key , item ) ;
42
42
}
43
43
}
44
44
}
0 commit comments