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

feat(tags): add mounted #42

Merged
merged 3 commits into from
May 27, 2024
Merged

feat(tags): add mounted #42

merged 3 commits into from
May 27, 2024

Conversation

sebkolind
Copy link
Collaborator

@sebkolind sebkolind commented May 27, 2024

This PR adds a mounted callback to attrs on tags. This is useful for mounting external libraries to the element when it's ready.

As an example you could use it like this to use https://codemirror.net:

div("", {
  // `el` is the element that `mounted` is added to
  mounted({ el }) {
    new EditorView({
      parent: el,
      extensions: [basicSetup, javascript()],
      doc: `function greet() {}`,
    });
  },
});

@sebkolind sebkolind self-assigned this May 27, 2024
@sebkolind sebkolind added the 🧪 experimental Things might explode label May 27, 2024
@sebkolind sebkolind changed the base branch from main to next May 27, 2024 13:50
@sebkolind sebkolind force-pushed the feat/tag-mounted branch 2 times, most recently from 6eb7b5f to 2c4e2b0 Compare May 27, 2024 16:39
@sebkolind sebkolind merged commit 641f405 into next May 27, 2024
1 check passed
@sebkolind sebkolind deleted the feat/tag-mounted branch May 27, 2024 18:27
sebkolind added a commit that referenced this pull request May 27, 2024
sebkolind added a commit that referenced this pull request May 27, 2024
sebkolind added a commit that referenced this pull request May 29, 2024
sebkolind added a commit that referenced this pull request Jun 2, 2024
sebkolind added a commit that referenced this pull request Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧪 experimental Things might explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant