Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to abort an old work when a new work started #45

Open
dehypnosis opened this issue Nov 24, 2017 · 1 comment
Open

Need to abort an old work when a new work started #45

dehypnosis opened this issue Nov 24, 2017 · 1 comment

Comments

@dehypnosis
Copy link

dehypnosis commented Nov 24, 2017

Hey! really appreciate to your hard work.
I met a problem with a withJobbed component when got a new work while the component already proceeding a job

scenario is like below:

  • a work promise A started => state: { completed: false }
  • the component received new props
  • new work promise B started => state: { completed: false }
  • the old work promise A threw an error => state: { completed: true, error: {..} }
  • an error component is mounted
  • new work promise B finished =>state: { completed: true, data: {..}, error: {..} }
  • ErrorComponent will be mounted in result

maybe another scenario can be like below:

  • a work promise A started => state: { completed: false }
  • the component received new props
  • new work promise B started => state: { completed: false }
  • new work promise B finished =>state: { completed: true, data: {..} }
  • the old work promise A finished => state: { completed: true, data: {.. overriden} }
  • a old job's data will be shown in result

I think it need to abort the old job or handle as abandoned when got a new job
Thanks in advance

@dehypnosis dehypnosis changed the title [bug] abort old work when a new work started Need to abort an old work when a new work started Nov 24, 2017
@ctrlplusb
Copy link
Owner

Apologies I have been out of action for so long. I will be reviewing this soon. Thanks for raising this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants