Merge branch 'master' of git.curoverse.com:arvados-workbench2 into 14307-search-basic...
[arvados-workbench2.git] / src / store / search-bar / search-bar-actions.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { unionize, ofType, UnionOf } from "~/common/unionize";
6
7 export const searchBarActions = unionize({
8     SET_CURRENT_VIEW: ofType<string>(),
9     OPEN_SEARCH_VIEW: ofType<{}>(),
10     CLOSE_SEARCH_VIEW: ofType<{}>()
11 });
12
13 export type SearchBarActions = UnionOf<typeof searchBarActions>;
14
15 export const goToView = (currentView: string) => searchBarActions.SET_CURRENT_VIEW(currentView);