1.0.5 • Published 9 months ago

@startinblox/component-piswap v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
9 months ago

Solid Piswap

This is a component integrating a basic feature of the Ontochain Piswap API, see exact ambition in #1

Access core within your component

Use core variable directly, eg.:

import('./utils.js').then(utils => {
  import(utils.coreVersion()).then(core => {
    customElements.define("solid-piswap",
      class extends core.SolidTemplateElement {
        constructor() {
          core.store.put({
            'username': 'Superman',
            '@context': this.context,
          }, 'http://server/users/admin/');
        }
      }
    );
  });
});

Target a local asset

Use the utils.path() function to return the actual path of your component (local or cdn), eg.:

import('./utils.js').then(utils => {
  import(utils.coreVersion()).then(core => {
    customElements.define("solid-piswap",
      class extends core.SolidTemplateElement {
        constructor() {
          core.Helpers.importCSS(utils.path() + '/styles/index.css?min');
        }
      }
    );
  });
});