(parentTopicId: string, displayName: string)
| 31 | let tmpId = 0 |
| 32 | |
| 33 | function makeOptimisticUpdater(parentTopicId: string, displayName: string) { |
| 34 | return (store: RecordSourceSelectorProxy) => { |
| 35 | tmpId += 1 |
| 36 | const id = `client:topic:${tmpId}` |
| 37 | const node = store.create(id, 'Topic') |
| 38 | |
| 39 | node.setValue(id, 'id') |
| 40 | node.setValue(displayName, 'displayName') |
| 41 | node.setValue(true, 'loading') |
| 42 | node.setValue(null, 'repoTopics') |
| 43 | node.setValue(false, 'showRepoOwnership') |
| 44 | |
| 45 | const topicEdge = store.create(`client:newEdge:${tmpId}`, 'TopicChildEdge') |
| 46 | topicEdge.setLinkedRecord(node, 'node') |
| 47 | |
| 48 | return insertEdge(parentTopicId, store, topicEdge) |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | function makeUpdater(parentTopicId: string) { |
| 53 | return (store: RecordSourceSelectorProxy) => { |
no test coverage detected