Skip to content

jkroso/presenter

Repository files navigation

presenter

Create MVC style Views and View classes. This is a highly experimental project aiming to find a nice composable style of defining interface components. Major influencers are the component entity systems which are becoming popular in game development. Though it also aims to allow inheritance. In presenter, components play the role of mixins though you can also think of them as providing a form a multiple inheritance.

Installation

With component, packin or npm

$ {package mananger} install jkroso/presenter

then in your app:

var view = require('presenter')

API

view(template, fn)

Create a new View class. if template is a function it will be passed model and can return either an Element or an HTML string.

var P = view('<p>{body}</p>')
new P({ body: 'some text' }).el
// <p>some text</p>

Stability

Experimental: Expect the unexpected. Please provide feedback on api and your use-case.

Running the tests

Just run make and navigate to the test directory

About

ui composition experiment

Resources

License

Stars

Watchers

Forks

Packages

No packages published