export type LinkState = { isEditing : boolean ; text : string ; url : string ; } ; const initialState = { isEditing : false , text : '' , url : '' , } ; export const link = { state : initialState , reducers : { startEdit ( state ) { state . isEditing = true ; return state ; } , reset ( state ) { state . isEditing = false ; state . text = '' ; state . url = '' ; return state ; } , setText ( state , text ) { state . text = text ; return state ; } , setUrl ( state , url ) { state . url = url ; return state ; } , } , } ;