0.0.24 • Published 7 years ago

cakejs2-spatial v0.0.24

Weekly downloads
21
License
MIT
Repository
github
Last release
7 years ago

CakeJs

Build Status Coveralls npm version license alpha

CakeJS2 lightweight front-end framework with only best parts and features of most awesome frameworks.

Features

Candle counter recipe:

create().route('/', 'counter');

Cream.extend({
  _namespace : 'counter',

  candles : 0,

  increment : function() {
    this.set('candles', this.candles + 1);
  },

  render : function() {
    return h('button', { onClick : this.increment }, 'Candles on the Cake: ' + this.candles);
  }
});

To enable JSX support, transpiler option have to be provided that names defaults with h (hyperscript) instead of react:

/** @jsx h */

Examples

Live demos:

Check out examples folder.

Installation

npm install cakejs2

CDN

https://unpkg.com/cakejs2@latest/dist/cake.min.js

API

create options:

create({
  element      : document.body // by default
  elementClass : cake
  elementId    : cake
  createRoot   : false        // do not create root node, use render's

route:

create().route(
 '/posts/:id/post',  // URL pattern, also available "*" pattern
 'home'             // Namespace of the component
 );

Namespaces

Namespaces

Cream

Base component of any cake.

Functions:

  • init
  • willTransition
  • didTransition
  • render

Options:

  • _namespsace - object's namespace
  • _after - DI after

Zefir:

  • props - routing options ( /:id/ for an instance became props.id )
  • params - params eg ?iam=param bacame params.iam

Sugar:

  • observes
  • property - computed property

observes creates observer function

  dataWatcher : function() { .... }.observes('posts', /^store/)

History

Cakejs2 is a second generation of the cakejs framework.

First version of cakejs were made in 2012th and published in 2014th.

License

MIT License

Copyright (c) 2016 Svetlana Linuxenko

0.0.24

7 years ago

0.0.23

7 years ago

0.0.22

7 years ago

0.0.21

7 years ago

0.0.20

7 years ago

0.0.19

7 years ago

0.0.18

7 years ago

0.0.17

7 years ago

0.0.16

7 years ago

0.0.15

7 years ago

0.0.14

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago