artalar / reatom

Reatom - the ultimate state manager
https://reatom.dev
MIT License
989 stars 104 forks source link

withAbord with strategy first-in-win doesn't work #897

Closed kasperskei closed 1 month ago

kasperskei commented 1 month ago

What happened?

After executing this code the console is empty:

import { createCtx, reatomAsync, sleep, withAbort } from '@reatom/framework'

const ctx = createCtx()

const func = reatomAsync(async (ctx, value) => {
  console.log(value)
  await ctx.schedule(() => sleep())
}).pipe(withAbort({ strategy: 'first-in-win' }))

func(ctx, 1)
func(ctx, 2)

Part

Package @reatom/async

Version

3.15.2

What browsers are you seeing the problem on?

No response

Relevant log output

1
artalar commented 1 month ago

fixed