Skip to content

Commit

Permalink
Update dev packages (babel, eslint, prettier) and fix resulting problems
Browse files Browse the repository at this point in the history
  • Loading branch information
sibnerian committed Jun 23, 2019
1 parent 9db6444 commit b2a6d5f
Show file tree
Hide file tree
Showing 11 changed files with 769 additions and 757 deletions.
7 changes: 5 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
},
"extends": "airbnb-base",
"rules": {
"no-plusplus": 0
"no-plusplus": "off",
"arrow-parens": ["error", "always"],
"prefer-destructuring": "off",
"implicit-arrow-linebreak": "off"
}
}
}
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"arrowParens": "always",
"singleQuote": true,
"trailingComma": "all"
}
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: node_js
node_js:
- "8"
- "7"
- "6"
- '8'
- '7'
- '6'
before_install:
- 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then npm install -g [email protected] ; elif [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then case "$(npm --version)" in 1.*) npm install -g [email protected] ;; 2.*) npm install -g npm@2 ;; esac ; fi'
- 'if [ "${TRAVIS_NODE_VERSION}" != "0.6" ] && [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then npm install -g npm; fi'
Expand All @@ -16,5 +16,5 @@ env:
matrix:
fast_finish: true
include:
- node_js: "node"
env: COVERAGE=true TEST=false
- node_js: 'node'
env: COVERAGE=true TEST=false
28 changes: 16 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
1.1.0 / 2017-07-10
==================
* Add middleware that can be used instead of `redux-thunk` if desired
# 1.2.0 / 2019-06-23

1.0.2 / 2017-07-02
==================
* Fix typos in package.json
- Update dev packages (babel, eslint, prettier) and fix resulting problems

1.0.1 / 2017-07-02
==================
* Update README.md
# 1.1.0 / 2017-07-10

1.0.0 / 2017-07-02
==================
* Initial release.
- Add middleware that can be used instead of `redux-thunk` if desired

# 1.0.2 / 2017-07-02

- Fix typos in package.json

# 1.0.1 / 2017-07-02

- Update README.md

# 1.0.0 / 2017-07-02

- Initial release.
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import selectorAction from 'selector-action';

export const reloadActiveItem = selectorAction(
activeIdSelector,
activeId => ({
(activeId) => ({
type: 'RELOAD_ACTIVE_ITEM',
promise: fetch(`//website.com/items/${activeId}`),
}),
Expand All @@ -20,7 +20,6 @@ export const reloadActiveItem = selectorAction(

### Background


**selector-action** simplifies a common Redux pattern: actions that depend on the
current Redux state. For example, when you're reloading an "active" item's data with an API call:

Expand All @@ -40,7 +39,7 @@ the action creators more complicated than they need to be. We could try using [`

```js
export function reloadActiveItem() {
// We can access the current state by returning a thunk.
// We can access the current state by returning a thunk.
return (dispatch, getState) => {
const state = getState();
const activeId = activeIdSelector(state);
Expand Down Expand Up @@ -71,7 +70,7 @@ import selectorAction from 'selector-action';

export const reloadActiveItem = selectorAction(
activeIdSelector,
activeId => ({
(activeId) => ({
type: 'RELOAD_ACTIVE_ITEM',
promise: fetch(`//website.com/items/${activeId}`),
}),
Expand Down Expand Up @@ -148,10 +147,10 @@ Like Reselect, you can pass in an array of selectors instead of passing them as
Here is a contrived example demonstrating this feature.

```js
export const awesomeAction = selectorAction([
fooSelector,
barSelector,
], (foo, bar) => ({ type: 'AWESOME!', payload: { foo, bar } }));
export const awesomeAction = selectorAction(
[fooSelector, barSelector],
(foo, bar) => ({ type: 'AWESOME!', payload: { foo, bar } }),
);
```

#### `selectorAction` with arguments
Expand All @@ -163,7 +162,7 @@ to compute a new state. This can be done by wrapping `selectorAction` in a highe

```js
export function setActiveItemName(newName) {
return selectorAction(activeIdSelector, activeId => ({
return selectorAction(activeIdSelector, (activeId) => ({
type: 'SET_ITEM_NAME',
payload: { activeId, newName },
}));
Expand Down
Loading

0 comments on commit b2a6d5f

Please sign in to comment.