Skip to content
This repository has been archived by the owner on Feb 25, 2024. It is now read-only.

Refactor notification events to use notifModel #87

Open
mattpocock opened this issue Jul 26, 2021 · 0 comments
Open

Refactor notification events to use notifModel #87

mattpocock opened this issue Jul 26, 2021 · 0 comments

Comments

@mattpocock
Copy link
Contributor

send(
  notifModel.events.BROADCAST(
    'An error occurred when saving.',
    'error',
  ),
  {
    to: (ctx) => {
      return ctx.notifRef!;
    },
  },
),

This is the new preferred pattern. The old pattern is:

send(
  (_, e: any) => ({
    type: 'BROADCAST',
    status: 'error',
    message: e.data.toString(),
  }),
  { to: (ctx: any) => ctx.notifRef },
)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant