You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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
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.
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?
The text was updated successfully, but these errors were encountered: