
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@wildberries/notifications
Advanced tools
npm install @wildberries/notifications
import {
notificationsState,
NOTIFICATIONS_REDUCER_NAME,
} from '@wildberries/notifications';
export const rootReducer = {
[NOTIFICATIONS_REDUCER_NAME]: notificationsState,
...other root reducers
};
import React, { memo } from "react";
import { Notifications, setModalAction } from "@wildberries/notifications";
import { createPortal } from 'react-dom';
import { uniqueId } from 'lodash-es'
const portalElement = document.getElementById('portal');
// example Portal component - you will need the DIV that will be appended by notifications
class Portal extends React.PureComponent{
constructor(props) {
super(props);
this.containerEl = document.createElement('div');
this.containerEl.id = `${props.prefix}_${uniqueId('id_')}`;
portalElement.appendChild(this.containerEl);
}
componentWillUnmount() {
this.containerEl.remove();
}
render() {
return createPortal(this.props.children, this.containerEl);
}
}
const TestComponent = memo(() => (
<div className="TestComponent">
<Portal prefix="notifications">
<Notifications />
</Portal>
</div>
);
})
success | error
- modal status (required)string
- modal test (required)string
- payload of additional action if need to call from modal (not required)any
- type of additional action if need to call from modal (not required)import React from "react";
import { setModalAction } from "@wildberries/notifications";
import { useDispatch } from "react-redux";
function ExampleComponent() {
const dispatch = useDispatch();
const setModal = () => {
dispatch(setModalAction({
status: 'success',
title: 'modal title',
text: 'modal text',
additionalPayload: { foo:'bar' },
additionalActionType: 'SOME_TYPE',
}))
}
return (
<div className="ExampleComponent">
<button onClick={setModal}>button</button>
</div>
);
}
export default App;
FAQs
notifications module
The npm package @wildberries/notifications receives a total of 8 weekly downloads. As such, @wildberries/notifications popularity was classified as not popular.
We found that @wildberries/notifications demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.