This repository has been archived by the owner on May 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(runtime): merges initial configuration with runtime
- Loading branch information
1 parent
2148b46
commit f7d689f
Showing
9 changed files
with
42 additions
and
63 deletions.
There are no files selected for viewing
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,18 @@ | ||
import { get } from 'lodash' | ||
|
||
import { INIT } from 'store/types' | ||
import actions from 'store/actions' | ||
import runtime from 'utils/runtime' | ||
|
||
import { handleActions } from 'utils/effects' | ||
|
||
export default handleActions({ | ||
[INIT]: ({ dispatch }, { payload }) => { | ||
const config = get(payload, 'runtime', {}) | ||
|
||
dispatch(actions.setRuntime({ | ||
...runtime, | ||
...config | ||
})) | ||
} | ||
}) |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import { createAction } from 'redux-actions' | ||
|
||
import { SET_LANGUAGE } from '../types' | ||
import { SET_LANGUAGE, SET_RUNTIME } from '../types' | ||
|
||
export const setLanguage = createAction(SET_LANGUAGE) | ||
export const setRuntime = createAction(SET_RUNTIME) |
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 |
---|---|---|
@@ -1,9 +1,16 @@ | ||
import test from 'ava' | ||
import { setLanguage } from './actions' | ||
import { setLanguage, setRuntime } from './actions' | ||
|
||
test(`setLanguage: creates the SET_LANGUAGE action`, t => { | ||
t.deepEqual(setLanguage('de'), { | ||
type: 'SET_LANGUAGE', | ||
payload: 'de' | ||
}) | ||
}) | ||
|
||
test(`setLanguage: creates the SET_LANGUAGE action`, t => { | ||
t.deepEqual(setRuntime({ language: 'de' }), { | ||
type: 'SET_RUNTIME', | ||
payload: { language: 'de' } | ||
}) | ||
}) |
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