This package include some utilities used by Drieam LTI apps.
Getting Started
Installation
Install the @drieam/common and
its dependencies.
yarn add @drieam/common
Read the full API Documentation
Options
General settings of an action as an extension of api actions.
{
withErrorHandler: true,
csrfToken: getCSRFToken(),
history: createBrowserHistory(),
toasts: {
offline: {
duration: 0,
message: 'Not connected.',
},
save: { message: 'Saved success.' },
delete: { message: 'Deleted success.' },
},
};
}
- Attributes:
withErrorHandler
(boolean
): Enables ErrorHandlingMiddleware (Default: true
). Provides feedback through an Antd Notification on offline, save success or fail action.toasts
(object
): Notification settings, you can express which message can be provided by the error handler.history
(object
): history
is a JavaScript library that lets you easily manage session history anywhere JavaScript runs. (default: require 'history'
).csfrToken
(string
): Cross-site request forgery token. (Default: <meta [name="csrf-token"] />
).- Api options