redux-saga-final-form
Advanced tools
Comparing version 1.0.2 to 1.1.0
{ | ||
"name": "redux-saga-final-form", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -18,14 +18,23 @@ redux-saga-final-form | ||
## Usage | ||
in your form component | ||
```javascript | ||
import { useListener } from 'redux-saga-final-form'; | ||
import { Form } from "react-final-form"; | ||
```javascript | ||
export const SettingsComponent = () => { | ||
const formListener = useListener(DOMAIN_SAVE_SETTINGS, DOMAIN_SAVE_SETTINGS_SUCCESS, DOMAIN_SAVE_SETTINGS_ERROR); | ||
return <Form initialValues={initialValues} onSubmit={formListener} validate={validate}> | ||
... | ||
</Form> | ||
} | ||
export const MyComponent = () => { | ||
const formListener = useListener(SUBMIT_START_ACTION, SUBMIT_SUCCESS_ACTION, SUBMIT_FAIL_ACTION); | ||
return ( | ||
<Form | ||
onSubmit={formListener} | ||
render={(formRenderProps) => ( | ||
<form onSubmit={formRenderProps.handleSubmit}> | ||
... | ||
</form> | ||
)} | ||
/> | ||
); | ||
}; | ||
``` | ||
@@ -36,3 +45,4 @@ | ||
```javascript | ||
import { finalFormSaga } from 'redux-saga-final-form'; | ||
import { finalFormSaga } from 'redux-saga-final-form'; | ||
import createSagaMiddleware from "redux-saga"; | ||
@@ -44,1 +54,10 @@ const sagaMiddleware = createSagaMiddleware(); | ||
SUBMIT_START_ACTION example: | ||
```javascript | ||
export const submitStatrAction = (payload: { formField1: string }) => ({ | ||
type: SUBMIT_START_ACTION | ||
payload | ||
}); | ||
``` | ||
@@ -29,3 +29,3 @@ import { useDispatch } from 'react-redux'; | ||
pendingCallbacks.delete(cbInfo.toClear) | ||
cbInfo.callback(); | ||
cbInfo.callback(action.payload); | ||
} | ||
@@ -35,2 +35,2 @@ | ||
yield takeEvery((action: any) => !!pendingCallbacks.get(action.type), handleEvent); | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12479
8
130
61
1