Socket
Book a DemoInstallSign in
Socket

@neovici/computing-lit-element

Package Overview
Dependencies
Maintainers
4
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@neovici/computing-lit-element

Add computed properties to LitElement

0.4.0
latest
Source
npmnpm
Version published
Weekly downloads
2
-85.71%
Maintainers
4
Weekly downloads
 
Created
Source

<computing-lit-element>

Adds computed properties functionality to LitElement.

This webcomponent follows the open-wc recommendation.

Installation

npm i computing-lit-element

Usage

<script type="module">
  import ComputingLitElement from 'computing-lit-element';
  
  class MyElement extends ComputingLitElement {
  	static get properties() {
    	return {
        	property1: {
            	type: Number
            },
           	property2: {
            	type: Number
            },
            computedProperty: {
            	type: Number,
                computed: 'computeComputedProperty(property1, property2)'
            }
       	};
    }
    constructor() {
    	super();
        this.property1 = 10;
        this.property2 = 5;
    }
    computeComputedProperty(property1, property2) {
    	return property1 * property2;
    }
  }
</script>
Or use the mixin
<script type="module">
  import computingMixin from 'computing-lit-element';
  import { LitElement } from 'lit-element';
  
  const ComputingLitElement = computingMixin(LitElement);
  ...

Testing using karma (if applied by author)

npm run test

Testing using karma via browserstack (if applied by author)

npm run test:bs

Linting (if applied by author)

npm run lint

FAQs

Package last updated on 07 Oct 2019

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.