PHP 8.2.30
Preview: use-notice.js Size: 709 B
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/adminjs/lib/frontend/hooks/use-notice.js

import { useDispatch } from 'react-redux';
import { addNotice } from '../store/actions/add-notice.js';

/**
 * @memberof useNotice
 * @alias AddNotice
 */

/**
 * @classdesc
 * Hook which allows you to add notice message to the app.
 *
 * ```javascript
 * import { useNotice, Button } from 'adminjs'
 *
 * const myComponent = () => {
 *   const sendNotice = useNotice()
 *   return (
 *     <Button onClick={() => sendNotice({ message: 'I am awesome' })}>I am awesome</Button>
 *   )
 * }
 * ```
 *
 * @class
 * @subcategory Hooks
 * @bundle
 * @hideconstructor
 */
export const useNotice = () => {
  const dispatch = useDispatch();
  return notice => dispatch(addNotice(notice));
};
export default useNotice;

Directory Contents

Dirs: 6 × Files: 10

Name Size Perms Modified Actions
- drwxr-xr-x 2026-02-28 00:31:56
Edit Download
- drwxr-xr-x 2026-02-28 00:31:56
Edit Download
- drwxr-xr-x 2026-02-28 00:31:56
Edit Download
- drwxr-xr-x 2026-02-28 00:31:56
Edit Download
- drwxr-xr-x 2026-02-28 00:31:56
Edit Download
- drwxr-xr-x 2026-02-28 00:31:58
Edit Download
563 B lrw-r--r-- 2026-02-28 00:31:44
Edit Download
1.19 KB lrw-r--r-- 2026-02-28 00:31:52
Edit Download
900 B lrw-r--r-- 2026-02-28 00:31:52
Edit Download
1.02 KB lrw-r--r-- 2026-02-28 00:31:52
Edit Download
3.07 KB lrw-r--r-- 2026-02-28 00:31:56
Edit Download
2.19 KB lrw-r--r-- 2026-02-28 00:31:52
Edit Download
2.16 KB lrw-r--r-- 2026-02-28 00:31:52
Edit Download
709 B lrw-r--r-- 2026-02-28 00:31:52
Edit Download
2.20 KB lrw-r--r-- 2026-02-28 00:31:52
Edit Download
1.34 KB lrw-r--r-- 2026-02-28 00:31:52
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).