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

chekhov

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chekhov

Chekhov Js

latest
Source
npmnpm
Version
1.1.3
Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

Chekhov

Chekhov Js Framework

Note

  • Although, Chekhov.JS (further ch.js) is a JS framework,

    it does not act like one you usually see and you should always keep that in mind


  • Remember that the script file should always be included after the closing tag
  • Key elements

  • The first thing you'll need when using ch.js is the values object
    let values =
        {
            all_kinds_of_data_you_need: all_the_values_you_need
        }
    

    then it's time to make a

    new Chekhov()
    

    like this

        let ch = new Chekhov({
            reactive: {
            // That's an example of a computed property
                msg: function () {
                    if (values.name == "")
                        return "What's your name?"
                    else
                        return `Bye ${values.name}! It was Great to meet you!`
                }
            }
        }, values)
    

    due to simpilcity of the framework it requires you to do a few things manually

    but it still provides some handy shortcuts

        <div ch-for linked="array" trigger="_iterator">
            <h1 class="central" ch-bind>{{iterator}}</h1>
        </div>
    

    for repeating something a few times but it requires setting up a computed property, that's pretty easy though

                _iterator: function (i) {
                    return values.array[i]
                }
    

    There's also ch-if

    <li ch-if linked="value">To display or not to display 💀</li>
    
    <button ch-model trigger="click" linked="switch">Continue</button>
    

    to call the linked method when the trigger event happens

    A little more

            <input ch-model linked="name" dep="msg" trigger="input"/>
    

    is used for calling the linked method when the trigger event happens

    Most important one

    Behold

     <h1 ch-bind>{{some_value}}</h1>
    

    which binds the inner value of the element to the property or a value contained in ch.data (e.g. ch.data.msg)

    Keywords

    tiny

    FAQs

    Package last updated on 29 May 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