How to use the effector/graphite/typedef.Cmd.emit function in effector

To help you get started, we’ve selected a few effector examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zerobias / effector / src / store / StepBox.js View on Github external
export function emit(
  subtype: 'event' | 'effect',
  fullName: string,
  runner: (ctx: any) => any,
) {
  return Cmd.emit({subtype, fullName, runner})
}
export function update(store: Ref) {
github zerobias / effector / src / event / concreteFabric.js View on Github external
event(args: {fullName: string, runner: Function}): GraphiteMeta {
    const unit = Cmd.emit({
      subtype: 'event',
      fullName: args.fullName,
      runner: args.runner,
    })
    const cmd = Step.single(unit)
    const nextSteps = Step.multi([])
    const stepFull = Step.seq([cmd, nextSteps])
    const graphite = {next: nextSteps, seq: stepFull}
    return graphite
  },
  prependEvent(args: {|