Skip to content

Unsure how to use unsafeType within defineNodeType #1194

Answered by Mearman
Mearman asked this question in Q&A
Discussion options

You must be logged in to vote

we edge closer.
to export, I need to type the const. though I can't figure out the correct config for the MonomorphicDefinition generics.
scratch that. I think I've got it

export const popNodeType: MonomorphicDefinition<
  {
    array: {
      type: AdvancedBreadboardType<unknown[]>;
    };
  },
  {
    last: {
      type: "unknown";
    };
    array: {
      type: AdvancedBreadboardType<unknown[]>;
    };
  }
> = defineNodeType({
  inputs: {
    array: {
      type: array("unknown"),
    },
  },
  outputs: {
    last: {
      type: "unknown",
    },
    array: {
      type: array("unknown"),
    },
  },
  invoke: <T>(inputs: { array: T[] }): { last: T | undefined; array: T[] } => {
    c…

Replies: 3 comments 5 replies

Comment options

Mearman
Mar 24, 2024
Collaborator Author

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@Mearman
Comment options

Mearman Mar 24, 2024
Collaborator Author

@aomarks
Comment options

@Mearman
Comment options

Mearman Mar 25, 2024
Collaborator Author

@Mearman
Comment options

Mearman Mar 25, 2024
Collaborator Author

Answer selected by Mearman
Comment options

Mearman
Mar 25, 2024
Collaborator Author

You must be logged in to vote
0 replies
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