This document details some tips and tricks for creating redux containers. Specifically, this document is looking at the mapDispatchToProps
argument of the connect
function from [react-redux][react-redux]. There are many ways to write the same thing in redux. This gist covers the various forms that mapDispatchToProps
can take.
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
" when triggering this command, vim will grab your path and line location and pass it along | |
map <Leader>el :call RemoteSendCommand(TestLineCommand(expand("%:p"), line(".")))<CR> | |
" because I'm mostly writing Elixir and making heavy use of the REPL while writing my tests, | |
" I made a specific command to user with Mix, the Elixir task utility | |
" But I'm sure you could get this to work with vim-test or something like that | |
function! TestLineCommand(path, line_number) | |
let cmd = join(["mix test --only", " line:", a:line_number, " ", a:path], "") | |
return cmd | |
endfunction |
Our applications have grown organically and our current collection of actions, reducers and selectors are due for an upgrade. This document is an attempt to outline an better way to organize our redux code.
The biggest changes here are the introduction of "modules" and redux-sagas.
- modules — a grouping of actions, constants, reducers, etc. that all deal with the same portion of the state.
- actions — action creators
OlderNewer