forked from andreaskoch/allmark
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update.go
33 lines (25 loc) · 910 Bytes
/
update.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright 2014 Andreas Koch. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package orchestrator
import (
"github.com/andreaskoch/allmark/common/route"
"github.com/andreaskoch/allmark/web/view/viewmodel"
)
type UpdateOrchestrator struct {
*Orchestrator
viewModelOrchestrator *ViewModelOrchestrator
}
func (orchestrator *UpdateOrchestrator) StartWatching(route route.Route) {
orchestrator.repository.StartWatching(route)
}
func (orchestrator *UpdateOrchestrator) StopWatching(route route.Route) {
orchestrator.repository.StopWatching(route)
}
func (orchestrator *UpdateOrchestrator) GetUpdatedModel(itemRoute route.Route) (viewModel viewmodel.Model, found bool) {
model, found := orchestrator.viewModelOrchestrator.GetFullViewModel(itemRoute)
if !found {
return viewmodel.Model{}, false
}
return model, true
}