Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@berslucas/liljs

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@berslucas/liljs

A DOM-driven micro-framework for Javascript applications

  • 4.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

liljs logo

File Size version David Dependency Status David devDependencyStatus PRs Welcome travis CI Gitter

Getting Started

For demos and examples, please visit lucasbersier.com/liljs

To start a liljs instance, you must call the function liljs with an html element to bootstrap to and an optional object with data for the first render cycle.

<div id="app">
  <!-- Elements using lil-* attributes -->
</div>

<script>
  liljs(document.querySelector('#app'), {
    propertyName: propertyValue,
    propertyName: propertyValue,
    ...
  }).then((app) => {
    
  });
</script>

The liljs promise will initialize and render your app, and the returned value, app will be a proxy containing all properties you have defined. To change a value, use app.propertyName and that value will be update both in your proxy and in the DOM.

Properties

A Property is a value attached to the liljs proxy that will update the proxy once the value is updated. Properties are created by adding attributes to the child elements of the element defined in the first parameter of liljs() when you initialize your instance.

Properties can be updated by changing their value. This will also re-render the element that the property is attached to.

addProp

Sometimes you'd like to add a property after the app has been rendered. This is possible by calling app.addProp on your proxy object.

liljs(document.querySelector('#app'), {
    propertyName: propertyValue,
    ...
}).then((app) => {
  app.addProp(
    name, type, elemList, value
  )
});

This function takes the following parameters:

NameTypeDescription
nameStringName of a property to add
typeStringBind type (style, text, list, ect...)
elemListArrayArray of element(s) to apply this property to
valueAnyName of the property to render

Keywords

FAQs

Package last updated on 28 Jul 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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc