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

Multiple callbacks not supported? #102

Open
Nilsen88 opened this issue Aug 26, 2016 · 2 comments
Open

Multiple callbacks not supported? #102

Nilsen88 opened this issue Aug 26, 2016 · 2 comments

Comments

@Nilsen88
Copy link

I have created an application that can be added to a page and configured. For the twitter feed I've used the Post-Fetcher to retrieve twitter posts. I have an issue with the customCallback function. If I have several of the application parts on my page that use twitter the customCallback function gets the same context.

For each app this is added in the twitterConfig.
"customCallback" handleTweets.bind(this)

But in the handleTweets function the "this" context is overwritten by the last customCallback that is called. I think it might need to create an independent instance for each callback. But this is not implemented right?

@Nilsen88
Copy link
Author

I've done customization to the code. Made global callback function that returns and creates a temp callback func for each instance. Also restructured the code so that you have instances of each twitterFetcher and not global variables. This solved my issue

@jasonmayes
Copy link
Owner

Ah interesting. Yes currently Twitter Fetcher is not a class, more like a singleton using the module design pattern originally. I shall add this as something to look into for the future, thanks for bringing it up.

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