gpui-kit icon indicating copy to clipboard operation
gpui-kit copied to clipboard

Add state traits via example Checkbox component

Open iamnbutler opened this issue 2 years ago • 2 comments

WIP

iamnbutler avatar Jan 28 '24 17:01 iamnbutler

@maxdeviant Any thoughts on the callbacks in the state traits?

I think including them there means they will be required – I don't know if there is a pattern we can use that makes it so that each individual callback may be implemented, but doesn't have to. Do they need to be separated out into their own traits?

iamnbutler avatar Jan 28 '24 17:01 iamnbutler

Also any thoughts on the naming pattern?

  • {state} - returns the current {state}
  • set_{state - sets the {state}
  • on_{some_action} - {some_action} callback

Also let me know if I'm using callback incorrectly 🤣

iamnbutler avatar Jan 28 '24 17:01 iamnbutler