github.com/soypat/vectytemplater@v0.0.0-20220501050640-d40b24e35168/_templates/default/store/actions/actions.go (about)

     1  package actions
     2  
     3  // Context contains all information to completely define a page layout.
     4  // It also has information on last page visited to enable the use of a "back" button.
     5  // It is not an "action" item strictly speaking.
     6  type Context struct {
     7  	// Defines the current page.
     8  	Page Page
     9  	// Referrer contains information on last page visited.
    10  	Referrer *Context
    11  	// Action can contain the executed action struct along with all
    12  	// data contained. Can be very useful though author is on the
    13  	// fence on whether it is good practice.
    14  	// Action interface{} // Uncomment for use.
    15  }
    16  
    17  type Page int
    18  
    19  const (
    20  	PageLanding Page = iota
    21  	PageNewItem
    22  )
    23  
    24  // PageSelect Navigates view to new page.
    25  type PageSelect struct {
    26  	Page Page
    27  }
    28  
    29  // NewItem action.
    30  type NewItem struct {
    31  	Item string
    32  }
    33  
    34  // Back button pressed. Navigate to previous page.
    35  type Back struct {
    36  }