New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@startinblox/component-needle

Package Overview
Dependencies
Maintainers
7
Versions
294
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@startinblox/component-needle

Needle

latest
npmnpm
Version
1.0.293
Version published
Maintainers
7
Created
Source

solid-needle

based on https://www.figma.com/file/67jvvnTwMEBkMzKhyuQUpX/Needle%2FPrototype

Other

User of prettier before commit !

npx prettier --write .
import * as core from "https://cdn.skypack.dev/@startinblox/core@0.17";

core.Sib.register({
  name: "solid-component",
  attributes: {
    dataAttribute: {
      // Attribute passed as `data-attribute=""`
      type: String,
      default: null,
    },
  },
  initialState: {
    // Initiale state of component
    state: null,
  },
  created() {
    // DOM component added
  },
  attached() {
    // Attributes attached
    core.render(
      // Use lit html template https://lit.dev/docs/v1/lit-html/introduction/
      core.html`
        <!-- HTML code here -->
        <div 
          @click=${this.onClick.bind(this)}
          ></div>
    `,
      this.element
    );
  },

  onClick(e) {
    // Click callback
    // console.log("attribute passed", this.dataAttribute);
    // console.log("component state", this.state);
  },
});

Component creation with resource

import * as core from "https://cdn.skypack.dev/@startinblox/core@0.17";

core.Sib.register({
  name: "solid-component",
  use: [core.StoreMixin],
  attributes: {
    dataAttribute: {
      // Attribute passed as `data-attribute=""`
      type: String,
      default: null,
    },
  },
  initialState: {
    // Initiale state of component
    state: null,
  },

  // Triggered when resource fetched from cache or backend
  // Source defined via data-src attribute
  // Resource stored in this.resource
  async populate() {
    if (!this.resource) {
      // Dont forget this as input data source can be invalid
      return;
    }

    core.render(
      core.html`
        <!-- HTML code here -->
    `,
      this.element
    );
  },
});

FAQs

Package last updated on 03 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts