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
store.dispatch({ | |
type: 'OPEN_NFE_VISUALIZATION', | |
accessKey: 123 | |
}) | |
store.dispatch({ | |
type: 'CLOSE_NFE_VISUALIZATION' | |
}) |
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
export default (action, state) => { | |
switch(action.type) { | |
case FIRST_EXAMPLE: | |
return { | |
...state, | |
quickbarIsOpen: true, | |
dfes: { | |
...state.dfes, | |
nfes: { | |
...state.dfes.nfes, |
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
export default (action, state) => { | |
switch(action.type) { | |
case FIRST_EXAMPLE: | |
return state | |
.updateIn( | |
["dfes", "nfes", "data", action.index], | |
data => data.set("visible", true) | |
) | |
.setIn("quickbarIsOpen", true) |
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
import { init } from "@rematch/core" | |
import * as models from "./models" | |
import * as reducers from "./reducers" | |
import { syncInitialStatePlugin } from "./plugins" | |
function initStore(initialStateModel ,initialStateRedux) { | |
store = init({ | |
models: models, | |
plugins: [syncInitialStatePlugin(initialStateModel)], |
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
import { List, Map } from 'immutable'; | |
export const scaffold = Map({ | |
currentIndex: 1, | |
inputValue: '', | |
items: List(), | |
}); | |
export default (state = scaffold, action) => { | |
switch (action.type) { |
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
export const getItems = state => state.get('items'); | |
export const getInputValue = state => state.get('inputValue'); | |
export const getCurrentIndex = state => state.get('currentIndex'); |
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
export const changeInputValue = value => ({ | |
type: 'CHANGE_INPUT_VALUE', | |
value, | |
}); | |
export const addItem = item => ({ | |
type: 'ADD_ITEM', | |
item, | |
}); |
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
import { Map } from 'immutable'; | |
import { getInputValue, getCurrentIndex } from './selectors'; | |
import { | |
addItem as addItemAction, | |
changeInputValue, | |
} from './actions'; | |
export const addItem = () => (dispatch, getState) => { | |
const state = getState(); |
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
export const localStorageSync = () => (_, getState) => { | |
const todos = getState().todos.toJS(); | |
localStorage.setItem('redux-todos', JSON.stringify(todos)); | |
}; |
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
local iron = require("iron.core") | |
local view = require("iron.view") | |
iron.setup { | |
config = { | |
-- Whether a repl should be discarded or not | |
scratch_repl = true, | |
-- Your repl definitions come here | |
repl_definition = { | |
sh = { |
OlderNewer