Skip to content

Commit

Permalink
feat: Release prep (#1)
Browse files Browse the repository at this point in the history
* fix vscode debugging task

* export "public" api from index

* update files
  • Loading branch information
mikew authored Aug 1, 2021
1 parent ec25011 commit 96f5581
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test: prepare-when-local
ifeq ($(CI),true)
npx jest --ci
else
npx jest --watch
npx --node-arg --inspect=9241 jest --watch
endif

deploy:
Expand Down
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ what will be the action's payload (or, if you'd prefer, you can return both a
payload and meta.)

```typescript
import { createActions } from 'redux-easy-mode'

export default createActions('example', {
// A simple action with no arguments or payload
increment: () => undefined,
Expand Down Expand Up @@ -54,6 +56,8 @@ export default createActions('example', {
It uses a builder pattern, so return types are inferred for you.

```typescript
import { createReducer } from 'redux-easy-mode'

import actions from './actions'

const initialState = {
Expand Down Expand Up @@ -132,7 +136,7 @@ This will dispatch 3 actions, in this order:

```typescript
import { applyMiddleware, createStore } from 'redux'
import asyncMiddleware from 'redux-easy-mode/async/asyncMiddleware'
import { asyncMiddleware } from 'redux-easy-mode'

const configureStore = applyMiddleware(asyncMiddleware())(createStore)
```
Expand Down Expand Up @@ -248,7 +252,7 @@ of the state changes based on a selector.

```typescript
import { applyMiddleware, createStore } from 'redux'
import sideEffectMiddleware from 'redux-easy-mode/sideEffects/sideEffectMiddleware'
import { sideEffectMiddleware } from 'redux-easy-mode'

const configureStore = applyMiddleware(sideEffectMiddleware())(createStore)
```
Expand All @@ -260,6 +264,8 @@ given access to the store, and can optionally return a function to do some
cleanup.

```ts
import { reduxActionSideEffect } from 'redux-easy-mode'

reduxActionSideEffect(actions.increment, ({ action, dispatch, getState }) => {
console.log(`${actions.increment.actionConstant} was dispatched`)

Expand All @@ -278,6 +284,8 @@ changed. You are given access to the store, and can optionally return a function
to do some cleanup.

```ts
import { reduxSelectorSideEffect } from 'redux-easy-mode'

reduxSelectorSideEffect(
(state: RootState) => state.some.value,
({ value, previousValue, dispatch, getState }) => {
Expand Down
12 changes: 3 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
"lib/createReducer.js",
"lib/createReducer.test.d.ts",
"lib/createReducer.test.js",
"lib/index.d.ts",
"lib/index.js",
"lib/isReduxActionCreator.d.ts",
"lib/isReduxActionCreator.js",
"lib/sideEffects/reduxActionSideEffect.d.ts",
Expand All @@ -47,14 +49,6 @@
"lib/sideEffects/reduxSelectorSideEffect.test.d.ts",
"lib/sideEffects/reduxSelectorSideEffect.test.js",
"lib/sideEffects/sideEffectMiddleware.d.ts",
"lib/sideEffects/sideEffectMiddleware.js",
"lib/test/helpers/setup.d.ts",
"lib/test/helpers/setup.js",
"lib/test/testActions.d.ts",
"lib/test/testActions.js",
"lib/test/testReducer.d.ts",
"lib/test/testReducer.js",
"lib/test/testStore.d.ts",
"lib/test/testStore.js"
"lib/sideEffects/sideEffectMiddleware.js"
]
}
6 changes: 6 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export { default as createActions } from './createActions'
export { default as createReducer } from './createReducer'
export { default as asyncMiddleware } from './async/asyncMiddleware'
export { default as sideEffectMiddleware } from './sideEffects/sideEffectMiddleware'
export { default as reduxActionSideEffect } from './sideEffects/reduxActionSideEffect'
export { default as reduxSelectorSideEffect } from './sideEffects/reduxSelectorSideEffect'

0 comments on commit 96f5581

Please sign in to comment.