@drieam/common
Version:
Default Drieam api wrapper
36 lines (31 loc) • 1.06 kB
Markdown
menu: '@drieam/common'
name: Options
route: /common/options
## `Options`
Settings of the action.
#### Example
```jsx
{
withErrorHandler: true,
csrfToken: getCSRFToken(),
history: createBrowserHistory(),
toasts: {
offline: {
duration: 0,
message: 'Not connected.',
},
save: { message: 'Saved success.' },
delete: { message: 'Deleted success.' },
},
};
}
```
#### Attributes
1. `withErrorHandler` (`boolean`): Enables ErrorHandlingMiddleware (Default: `true`).
Provides feedback through an [Antd Notification](https://ant.design/components/notification/) on offline, save success or fail action.
1. `toasts` (`object`): Notification settings, you can express which message can be provided by the error handler.
1. `history` (`object`): `history` is a JavaScript library that lets you easily manage session history anywhere JavaScript runs. (default: `require 'history'`).
1. `csfrToken` (`string`): Cross-site request forgery token. (Default: `<meta [name="csrf-token"] />`).
1. [Other options](/api/options)