-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
William Nadeau
committed
Apr 18, 2018
1 parent
bc88bd7
commit a978a45
Showing
21 changed files
with
384 additions
and
317 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
export default class Cache<T> { | ||
private internalCache: {[key: string]: T} = {}; | ||
|
||
public getFromCache(key: string, valueCreator: (key: string) => T) : T { | ||
const cachedValue = this.internalCache[key]; | ||
|
||
if (cachedValue) { | ||
return cachedValue; | ||
} | ||
|
||
var calculated = valueCreator(key); | ||
|
||
this.internalCache[key] = calculated; | ||
|
||
return calculated; | ||
} | ||
|
||
public clear() { | ||
this.internalCache = {}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import * as SheetActions from '../sheet/sheetActions'; | ||
|
||
type RootAction = | ||
SheetActions.CreateSheetAction | | ||
SheetActions.DeleteSheetAction | | ||
SheetActions.UpdateSheetAction | | ||
SheetActions.LoadSheetsAction; | ||
|
||
export default RootAction; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import SheetState from '../sheet/SheetState'; | ||
|
||
type RootState = { | ||
sheetState: SheetState | ||
}; | ||
|
||
export default RootState; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import RootState from '../core/RootState'; | ||
|
||
const initialState: RootState = { | ||
sheetState: { | ||
sheets: [] | ||
} | ||
}; | ||
|
||
export default initialState; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { combineReducers } from 'redux'; | ||
import RootState from './RootState'; | ||
import RootAction from './RootAction'; | ||
import sheetReducer from '../sheet/sheetReducer'; | ||
|
||
const rootReducer = combineReducers<RootState, RootAction>( | ||
{ | ||
sheetState: sheetReducer | ||
}); | ||
|
||
export default rootReducer; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.