Skip to content

Commit

Permalink
Add Kea logic paths for easier debugging/defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed Sep 17, 2020
1 parent bd6b389 commit 8da3ce2
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface IAppActions {
}

export const AppLogic = kea<MakeLogicType<IAppValues, IAppActions>>({
path: ['enterpriseSearch', 'appSearch', 'app'],
actions: {
initializeAppData: (props) => props,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const convertToArray = (messages: IFlashMessage | IFlashMessage[]) =>
!Array.isArray(messages) ? [messages] : messages;

export const FlashMessagesLogic = kea<MakeLogicType<IFlashMessagesValues, IFlashMessagesActions>>({
path: ['enterpriseSearch', 'flashMessages'],
actions: {
setFlashMessages: (messages) => ({ messages: convertToArray(messages) }),
clearFlashMessages: () => null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export interface IHttpActions {
}

export const HttpLogic = kea<MakeLogicType<IHttpValues, IHttpActions>>({
path: ['enterpriseSearch', 'http'],
actions: {
initializeHttp: ({ http, errorConnecting }) => ({ http, errorConnecting }),
initializeHttpInterceptors: () => null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export interface IAppActions {
}

export const AppLogic = kea<MakeLogicType<IAppValues, IAppActions>>({
path: ['enterpriseSearch', 'workplaceSearch', 'app'],
actions: {
initializeAppData: ({ workplaceSearch, isFederatedAuth }) => ({
workplaceSearch,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export interface IOverviewValues extends IOverviewServerData {
}

export const OverviewLogic = kea<MakeLogicType<IOverviewValues, IOverviewActions>>({
path: ['enterpriseSearch', 'workplaceSearch', 'overview'],
actions: {
setServerData: (serverData) => serverData,
initializeOverview: () => null,
Expand Down

0 comments on commit 8da3ce2

Please sign in to comment.