Skip to content
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

[core] NodeReference type for references to nodes #720

Merged
merged 4 commits into from
Aug 2, 2022
Merged

Conversation

bharatkashyap
Copy link
Member

@render
Copy link

render bot commented Aug 1, 2022

@oliviertassinari oliviertassinari requested a deployment to ref-type - toolpad-db PR #720 August 1, 2022 18:06 — with Render Abandoned
@Janpot
Copy link
Member

Janpot commented Aug 2, 2022

Looking good. Would it make sense to abstract all .$$ref access behind

// ./appDom.js
export function ref(nodeId: NodeId): NodeReference;
export function deref(ref: NodeReference): NodeId;

@bharatkashyap
Copy link
Member Author

Looking good. Would it make sense to abstract all .$$ref access behind

// ./appDom.js
export function ref(nodeId: NodeId): NodeReference;
export function deref(ref: NodeReference): NodeId;

Would this look something like:

//ToolpadApp.tsx

- navigateToPage(page.$$ref);
+ navigateToPage(appDom.deref(page));

@Janpot
Copy link
Member

Janpot commented Aug 2, 2022

Would this look something like

Exactly, hiding away the implementation details

Copy link
Member

@Janpot Janpot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 nice

@bharatkashyap bharatkashyap merged commit 5409576 into master Aug 2, 2022
@bharatkashyap bharatkashyap deleted the ref-type branch August 2, 2022 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants