delete-sync-scope
Action deletes a specific sync scope from the _syncScope database table using its sync-scope ID.
Examples and code snippets
In this example, three entities (database tables) are synced using
action.sync-entities, namely:earthquake (REST)
hike (Dynamica Data)
penguins ( Dynamic Data)
The
action.start-sync-scopeis used to write the scope of the database tables to the local _syncScope table.A datasource is configured against the _syncScope table, and the details are returned in a list (for visibility in this example).
The
action.delete-sync-scopeis used to delete the scope that was written to the _syncScope table using theinstanceIdgiven in theaction.start-sync-scope.
title: Sync-scope examples
type: jig.default
children:
- type: component.list
options:
# Bind data from the sync-scopes datasource
data: =@ctx.datasources.sync-scopes
maximumItemsToRender: 8
item:
type: component.list-item
options:
# Display the sync scope state (syncing, synced, failed, interrupted)
title:
text: =@ctx.current.item.state
# Display the details JSON structure as subtitle
subtitle:
text: =@ctx.current.item.details
fontSize: regular
numberOfLines: 3
# Show the sync scope ID on the right side of the list item
rightElement:
element: text
firstLine: =@ctx.current.item.id
# Define actions available for each sync scope
actions:
- numberOfVisibleActions: 2
children:
# Action to start a new sync scope.
- type: action.start-sync-scope
# Specify a unique identifier for this sync scope action.
instanceId: sync-all
options:
# List the individual instanceIds of each sync (sync-entities)
# that the sync scope applies to.
instanceIds:
- sync-quakes
- sync-enviro
title: Start sync
# Action to delete a specific sync scope from the _syncScope table
# using the instanceId of the start-sync action as a reference.
- type: action.delete-sync-scope
options:
# ID of the sync scope to delete (matches instanceId above)
id: sync-all
title: Delete scope
Last updated
Was this helpful?