Skip to content

Commit

Permalink
Use a default export to trick import for different environments
Browse files Browse the repository at this point in the history
  • Loading branch information
kinow committed Oct 12, 2019
1 parent f38fcfc commit 1bc12af
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import router from '@/router'
import store from '@/store'

// GraphQL client
import { SubscriptionWorkflowService } from 'workflow-service'
import SubscriptionWorkflowService from 'workflow-service'

// Sync store with router
sync(store, router)
Expand Down
8 changes: 4 additions & 4 deletions src/services/mock/workflow.service.mock.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { checkpoint } from '@/services/mock/checkpoint.js'
import { GQuery } from '@/services/gquery'
import store from '@/store/'
import store from '@/store/index'

class MockWorkflowService extends GQuery {
/**
Expand All @@ -11,7 +11,7 @@ class MockWorkflowService extends GQuery {
constructor () {
super(/* enableWebSockets */ false)
// load mock data
store.dispatch('workflows/set', checkpoint.workflows)
store.dispatch('workflows/set', checkpoint.workflows).then(() => {})
}

subscribe (view, query) {
Expand All @@ -28,6 +28,6 @@ class MockWorkflowService extends GQuery {
}
}

const workflowService = new MockWorkflowService()
export { MockWorkflowService }

export { workflowService }
export default MockWorkflowService
1 change: 1 addition & 0 deletions src/services/workflow.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,4 @@ class SubscriptionWorkflowService extends GQuery {
}

export { LiveWorkflowService, SubscriptionWorkflowService }
export default SubscriptionWorkflowService

0 comments on commit 1bc12af

Please sign in to comment.