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

Callbacks not working as expected #704

Open
bdgroupdev opened this issue Oct 22, 2020 · 1 comment
Open

Callbacks not working as expected #704

bdgroupdev opened this issue Oct 22, 2020 · 1 comment

Comments

@bdgroupdev
Copy link

I'm not sure this is an issue, but the callbacks are not working as I would expect them to.

Here's what I would expect:

after : called after Instafeed.run() regardless of success or failure
before: called at the beginning of Instafeed.run()
success : called after Instafeed.run() only if successful
error : called after Instafeed.run() only if error

With Instafeed v2.0.0-rc2 an invalid access_token calls the error() callback function, but not the after() function. Instead it throws an 400 error, which should be handled by the callback, right?

Please let me know if I'm misunderstanding something here.

@stevenschobert
Copy link
Owner

Hey @bdgroupdev! Thanks for the report!

Looks like the docs are misleading here. The after function (in both v1 and v2) is only called after the images have successfully been inserted into the page. If any failure is hit during the process, the error callback will be called instead.

Sorry about that, the v2 documentation is still a work-in-progress and needs some work. We'll get this fixed!

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