MCPcopy
hub / github.com/codesandbox/codesandbox-client / addNotification

Function addNotification

packages/app/src/app/store/factories.js:58–76  ·  view source on GitHub ↗
(
  title,
  notificationType,
  timeAlive = 2,
  buttons = []
)

Source from the content-addressed store, hash-verified

56}
57
58export function addNotification(
59 title,
60 notificationType,
61 timeAlive = 2,
62 buttons = []
63) {
64 // eslint-disable-next-line
65 return function addNotification({ state, resolve }) {
66 const now = Date.now();
67
68 state.push('notifications', {
69 id: now,
70 title: resolve.value(title),
71 notificationType: resolve.value(notificationType),
72 buttons: resolve.value(buttons),
73 endTime: now + resolve.value(timeAlive) * 1000,
74 });
75 };
76}
77
78export function updateSandboxUrl(sandbox) {
79 // eslint-disable-next-line

Callers 7

sequences.jsFile · 0.90
sequences.jsFile · 0.90
sequences.jsFile · 0.90
sequences.jsFile · 0.90
sequences.jsFile · 0.90
showErrorFunction · 0.90
withLoadAppFunction · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected