GithubHelp home page GithubHelp logo

rift's Introduction

Rift

Rift is an easy to use (and experimental) component based dom renderer. Rift has an easy to use component system. You just create components and Rift handles the rest. You can focus on programming your application instead of fighting with frameworks.

Rift works in plain Javascript and doesn't need any preprocessing to work, or be manageable. This is thanks to Rift's easy to use r (Shortcut) template strings!

Usage

Creating components is easy in Rift. Just extend Component and register it!. Any time you use the component inside another component Rift with automagically use the right component. State isn't some annoying object or function. You just define your variables and anytime they are updated, the component updates.

class ExampleComponent extends Component {

    isClicked = false

    onClick() {
        this.isClicked = !this.isClicked
    }

    render() {
        return r`
        <div>
            <a>This is a component!</a>
            <button onclick="${this.onClick.bind(this)}">${this.isClicked ? 'Clicked' : 'Not clicked'}</button>
        </div>`
    }
}

To start rendering your components call Rift.root passing in your dom root element and your main component.

For a full example check example.js

This framework is still a Work In Progress. Don't expect everything to work as intended.

Created by ThuverX with ๐Ÿงก and โ˜•

rift's People

Contributors

thuverx avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.