Skip to content

Update doesn't work via model method #474

Answered by muesli
andrewebdev asked this question in Q&A
Discussion options

You must be logged in to vote
func (m Model) Next() tea.Cmd {
...
}

This function is working on a copy of your Model. If you change it to a pointer receiver, it will correctly update:

func (m *Model) Next() tea.Cmd {
...
}

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@andrewebdev
Comment options

@muesli
Comment options

Answer selected by andrewebdev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants