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

Add refreshEnabled trait and AsyncMappableMixin to AutoRefreshMixin #4512

Merged
merged 11 commits into from
Jul 13, 2020

Conversation

nf-s
Copy link
Contributor

@nf-s nf-s commented Jul 7, 2020

Add refreshEnabled trait and AsyncMappableMixin to AutoRefreshMixin

This adds a 'toggle' trait so the AutoRefreshMixin can be turned off or back on.

Example with 2 CSV catalog items: one with refreshEnabled=true and one with refershEnabled=false:
http://ci.terria.io/autorefreshmixin-refreshenabled/#clean&https://gist.githubusercontent.com/nf-s/7add30fc21d000e5e1710faf09e0dc4b/raw/1abf730796ef82d8c332d3aec7d7a2eec3db90d6/polling.json

Motivation

This is used in the CatalogFunctionMixin and CatalogFuntionJobMixin - #4229

For example - here https://github.com/TerriaJS/terriajs/blob/79d51860836270eff93eab6008a73298c81b689b/lib/ModelMixins/CatalogFunctionJobMixin.ts

@nf-s nf-s marked this pull request as ready for review July 9, 2020 09:24
@nf-s nf-s requested a review from tephenavies July 9, 2020 09:24
@@ -33,6 +34,7 @@ class PollingTraits extends ModelTraits {
}

export default class CsvCatalogItemTraits extends mixTraits(
AutoRefreshingTraits,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this shouldn't be here, as all AutoRefreshingTraits are computed values in CsvCatalogItem

Copy link
Contributor

@rowanwins rowanwins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks reasonable to me @nf-s

@nf-s nf-s merged commit 7f0f7ba into next Jul 13, 2020
@nf-s nf-s deleted the autorefreshmixin-refreshenabled branch July 13, 2020 05:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants