Skip to content

Commit 463f2c0

Browse files
committed
refactor(stores): filter jsdocs
Signed-off-by: Adam Setch <adam.setch@outlook.com>
1 parent bd03314 commit 463f2c0

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/renderer/stores/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export * from './types';
22

3+
export * from './defaults';
34
export { default as useFiltersStore } from './useFiltersStore';

src/renderer/stores/useFiltersStore.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type { FiltersStore } from './types';
88
import { DEFAULT_FILTERS_STATE } from './defaults';
99

1010
/**
11-
* Atlassify Filters store.
11+
* Gitify Filters store.
1212
*
1313
* Automatically persisted to local storage
1414
*/
@@ -17,6 +17,7 @@ const useFiltersStore = create<FiltersStore>()(
1717
(set, get, store) => ({
1818
...DEFAULT_FILTERS_STATE,
1919

20+
/** Returns `true` if any filter group has one or more active values. */
2021
hasActiveFilters: () => {
2122
const state = get();
2223
return (
@@ -29,6 +30,7 @@ const useFiltersStore = create<FiltersStore>()(
2930
);
3031
},
3132

33+
/** Adds or removes a single filter value for the given filter key based on the `checked` flag. */
3234
updateFilter: (key, value, checked) => {
3335
set((state) => {
3436
const current = state[key];
@@ -43,6 +45,7 @@ const useFiltersStore = create<FiltersStore>()(
4345
});
4446
},
4547

48+
/** Resets the store to its initial state, clearing all active filters. */
4649
reset: () => {
4750
set(store.getInitialState());
4851
},

0 commit comments

Comments
 (0)