github.com/soypat/vectytemplater@v0.0.0-20220501050640-d40b24e35168/_templates/websocket-cli/app/store/actions/actions.go (about) 1 package actions 2 3 import "vecty-templater-project/model" 4 5 // Context contains all information to completely define a page layout. 6 // It also has information on last page visited to enable the use of a "back" button. 7 // It is not an "action" item strictly speaking. 8 type Context struct { 9 // Defines the current page. 10 Page Page 11 // Referrer contains information on last page visited. 12 Referrer *Context 13 // Action can contain the executed action struct along with all 14 // data contained. Can be very useful though author is on the 15 // fence on whether it is good practice. 16 // Action interface{} // Uncomment for use. 17 } 18 19 type Page int 20 21 const ( 22 PageLanding Page = iota 23 PageNewItem 24 ) 25 26 // PageSelect Navigates view to new page. 27 type PageSelect struct { 28 Page Page 29 } 30 31 // NewItem action. 32 type NewItem struct { 33 Item model.Item 34 } 35 36 // Back button pressed. Navigate to previous page. 37 type Back struct { 38 } 39 40 // Refresh just updates page by calling rendering functions. 41 type Refresh struct{}