Skip to content

Commit

Permalink
Address all feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Kornil committed May 13, 2020
1 parent 0b002c6 commit 29e1e1e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 28 deletions.
28 changes: 2 additions & 26 deletions packages/gatsby/src/redux/reducers/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,14 @@ import normalize from "normalize-path"
import { interpret } from "xstate"

import { componentMachine } from "../machines/page-component"
import {
IGatsbyState,
IDeleteCacheAction,
ISetProgramStatusAction,
ICreatePageAction,
IQueryExtractedAction,
IQueryExtractedBabelSuccessAction,
IQueryExtractionBabelErrorAction,
IQueryExtractionGraphQLErrorAction,
IPageQueryRunAction,
IDeletePageAction,
IRemoveTemplateComponentAction,
} from "../types"
import { IGatsbyState, ActionsUnion } from "../types"

const services = new Map()
let programStatus = `BOOTSTRAPPING`

type Actions =
| IDeleteCacheAction
| ISetProgramStatusAction
| ICreatePageAction
| IQueryExtractedAction
| IQueryExtractedBabelSuccessAction
| IQueryExtractionBabelErrorAction
| IQueryExtractionGraphQLErrorAction
| IPageQueryRunAction
| IRemoveTemplateComponentAction
| IDeletePageAction

export const components = (
state: IGatsbyState["components"] = new Map(),
action: Actions
action: ActionsUnion
): IGatsbyState["components"] => {
switch (action.type) {
case `DELETE_CACHE`:
Expand Down
4 changes: 2 additions & 2 deletions packages/gatsby/src/redux/reducers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { webpackCompilationHashReducer } from "./webpack-compilation-hash"
import { reducer as logReducer } from "gatsby-cli/lib/reporter/redux/reducer"
import { lastAction } from "./last-action"
import { jobsV2Reducer } from "./jobsv2"
import { componenents } from "./components"
import { components } from "./components"

/**
* @property exports.nodesTouched Set<string>
Expand All @@ -30,7 +30,7 @@ module.exports = {
pages: pagesReducer,
status: statusReducer,
componentDataDependencies: require(`./component-data-dependencies`),
components: componenents,
components: components,
staticQueryComponents: staticQueryComponentsReducer,
jobs: require(`./jobs`),
jobsV2: jobsV2Reducer,
Expand Down
1 change: 1 addition & 0 deletions packages/gatsby/src/redux/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ export type ActionsUnion =
| ICreateJobV2Action
| IEndJobV2Action
| IRemoveStaleJobV2Action
| IRemoveTemplateComponentAction

export interface ICreateJobV2Action {
type: `CREATE_JOB_V2`
Expand Down

0 comments on commit 29e1e1e

Please sign in to comment.