@uprtcl/lenses
    TypeScript icon, indicating that this package has built-in type declarations

    0.1.3 • Public • Published

    @uprtcl/lenses

    This package provides a basic lenses rendering engine for the @uprtcl/cortex framework. Cortex needs a rendering engine of this type in order for it to work in the frontend.

    This module declares and exposes this native HTMLElement:

    • <cortex-entity>: entry point of the engine. This element takes a hash property, and is responsible for fetching, recognizing, and rendering the object in the appropiate lens.

    Documentation

    Visit our documentation site.

    Install

    npm install @uprtcl/lenses

    Usage

    Import the module, instantiate it with its appropiate configuration, and load it:

    import { MicroOrchestrator } from '@uprtcl/micro-orchestrator';
    import { LensesBindings } from '@uprtcl/cortex';
    import { LensesModule } from '@uprtcl/lenses';
    
    const orchestrator = new MicroOrchestrator();
    
    const lenses = new LensesModule();
    await orchestrator.loadModule(lenses);

    In your html, now you can use <cortex-entity>:

    <cortex-entity
      id="cortex-entity-rendering"
      uref="<REFERENCE-TO-THE-ENTITY-WE-WANT-TO-LOAD>"
    />

    For now, the only type of supported reference is a the hash of the entity to load. Support for new types of reference will be added soon.

    Install

    npm i @uprtcl/lenses

    Homepage

    uprtcl.io

    DownloadsWeekly Downloads

    2

    Version

    0.1.3

    License

    MIT

    Unpacked Size

    122 kB

    Total Files

    43

    Last publish

    Collaborators

    • sotous
    • guillem.cordoba
    • pepoospina