Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated MakeAsyncFunction prop types to accept an ActionMatcher #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ Most of the popular React form libraries accept an `onSubmit` function that is e

<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

* [Usage](#usage)
* [Step 1](#step-1)
* [Step 2](#step-2)
* [API](#api)
* [`MakeAsyncFunction: React.Component<Props>`](#makeasyncfunction-reactcomponentprops)
* [Types](#types)
* [`Props`](#props)
* [`start: string`](#start-string)
* [`resolve: string`](#resolve-string)
* [`reject: string`](#reject-string)
* [`setPayload?: (action: Object, payload: any) => Object`](#setpayload-action-object-payload-any--object)
* [`getPayload?: (action: Object) => any`](#getpayload-action-object--any)
* [`getError?: (action: Object) => any`](#geterror-action-object--any)
- [Usage](#usage)
- [Step 1](#step-1)
- [Step 2](#step-2)
- [API](#api)
- [`MakeAsyncFunction: React.Component<Props>`](#makeasyncfunction-reactcomponentprops)
- [Types](#types)
- [`Props`](#props)
- [`start: string`](#start-string)
- [`resolve: string | ActionMatcher`](#resolve-string--actionmatcher)
- [`reject: string | ActionMatcher`](#reject-string--actionmatcher)
- [`setPayload?: (action: Object, payload: any) => Object`](#setpayload-action-object-payload-any--object)
- [`getPayload?: (action: Object) => any`](#getpayload-action-object--any)
- [`getError?: (action: Object) => any`](#geterror-action-object--any)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

Expand Down
34 changes: 24 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"react-dom": "^16.4.1",
"react-redux": "^5.0.7",
"redux": "^4.0.0",
"redux-promise-listener": "^1.0.0",
"redux-promise-listener": "^1.1.0",
"rollup": "^0.63.5",
"rollup-plugin-babel": "^3.0.7",
"rollup-plugin-commonjs": "^9.1.4",
Expand All @@ -68,7 +68,7 @@
},
"peerDependencies": {
"redux": ">=3.0.0",
"redux-promise-listener": ">=1.0.0",
"redux-promise-listener": ">=1.1.0",
"prop-types": "^15.6.0",
"react": "^15.3.0 || ^16.0.0",
"react-redux": ">=5.0.0"
Expand Down
4 changes: 2 additions & 2 deletions src/MakeAsyncFunction.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export default class MakeAsyncFunction extends React.Component<Props, State> {
children: PropTypes.func.isRequired,
listener: PropTypes.object.isRequired,
start: PropTypes.string.isRequired,
resolve: PropTypes.string.isRequired,
reject: PropTypes.string.isRequired,
resolve: PropTypes.oneOfType([PropTypes.string, PropTypes.func]).isRequired,
reject: PropTypes.oneOfType([PropTypes.string, PropTypes.func]).isRequired,
setPayload: PropTypes.func,
getPayload: PropTypes.func,
getError: PropTypes.func
Expand Down
10 changes: 7 additions & 3 deletions src/index.js.flow
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
// @flow
import * as React from 'react'
import type { SetPayload, GetPayload } from 'redux-promise-listener'
import type {
SetPayload,
GetPayload,
ActionMatcher
} from 'redux-promise-listener'

type Props = {
start: string,
resolve: string,
reject: string,
resolve: string | ActionMatcher,
reject: string | ActionMatcher,
setPayload?: SetPayload,
getPayload?: GetPayload,
getError?: GetPayload
Expand Down