-
Notifications
You must be signed in to change notification settings - Fork 9
pattern to have an array of charms in a cell #1771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
UI to navigate to each charm created in the array
048631c to
3f2a7d3
Compare
| properties: { | ||
| charm: { type: "object" }, | ||
| cellRef: { type: "array", asCell: true }, | ||
| isInitialized: { type: "boolean", asCell: true }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a default: false here, and then this becomes optional as input (see other comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh! there is a chance this doesn't work yet, i realize (internal: recipes treat inputs as cells by defaults, lifts as static data and i'm not sure whether we're taking the hint here correctly to make a dynamic cell, i think it might create a read-only cell)
but instead of having to do the gymnastics for the isInitalized here in the calling recipe, you could use createCell inside the lift. The static cause you provide it makes sure that you are getting the latest value on every run.
| const charm = SimpleRecipe({}); | ||
|
|
||
| // Store the charm in the array and navigate | ||
| return addCharmAndNavigate({ charm, cellRef, isInitialized }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by making it default false you can omit it here and so don't even need to create this cell.
UI to navigate to each charm created in the array
Summary by cubic
Adds a Charms Launcher pattern that stores an array of charm references in a named cell and lets users create and navigate to each charm. Addresses CT-865 by providing a persistent charm list with navigation.