Skip to content

Commit

Permalink
Merge pull request #42 from drma-dev/main
Browse files Browse the repository at this point in the history
Add ContainKeyAsync
  • Loading branch information
chrissainty authored Jan 20, 2021
2 parents aacf993 + 86d3081 commit fc2fda0
Show file tree
Hide file tree
Showing 3 changed files with 190 additions and 163 deletions.
10 changes: 9 additions & 1 deletion src/Blazored.SessionStorage/ISessionStorageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,21 @@ public interface ISessionStorageService

Task<string> KeyAsync(int index);

/// <summary>
/// Checks if the key exists in Session Storage but does not check the value.
/// </summary>
/// <param name="key">name of the key</param>
/// <returns>True if the key exist, false otherwise</returns>
Task<bool> ContainKeyAsync(string key);

Task<int> LengthAsync();

Task RemoveItemAsync(string key);

Task SetItemAsync<T>(string key, T data);

event EventHandler<ChangingEventArgs> Changing;

event EventHandler<ChangedEventArgs> Changed;
}
}
}
8 changes: 8 additions & 0 deletions src/Blazored.SessionStorage/ISyncSessionStorageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,21 @@ public interface ISyncSessionStorageService

string Key(int index);

/// <summary>
/// Checks if the key exists in Session Storage but does not check the value.
/// </summary>
/// <param name="key">name of the key</param>
/// <returns>True if the key exist, false otherwise</returns>
bool ContainKey(string key);

int Length();

void RemoveItem(string key);

void SetItem<T>(string key, T data);

event EventHandler<ChangingEventArgs> Changing;

event EventHandler<ChangedEventArgs> Changed;
}
}
Loading

0 comments on commit fc2fda0

Please sign in to comment.