0.6.9 • Published 5 years ago

@omen/core v0.6.9

Weekly downloads
1
License
AGPL-3.0
Repository
github
Last release
5 years ago

omen

ONE STATE, ONE APP!

A simple data driven frontend library using JSX.

There are some major differences to render based libraries like React:

  • no render cycle, no shadow DOM, no complicated change detection
  • data is set with observables

install and run

npm i -S @omen/cli
omen serve

example:

import omen from '../../../core/lib/renderer';

const App = (props, state, data) => {
  const entries = data.entries.map(
    (value) => (
      <span style={
        value.transform(v => v && {color: v.color})
      }>
        {value.child('title')}
      </span>
    )
  );

  return (
    <div className="app">
      <h1>{props.title}</h1>
      <p>{entries}</p>
    </div>
  );
};

App.data = {
  entries: 'app',
};

const initialState = {
  'app': [
    {title: 'Hello', color: '#fe8d00'},
    {title: 'World', color: '#333333'},
  ],
};

omen.render(
  document.getElementById('app'),
  <App/>,
  {
    getInitialState: () => Promise.resolve(initialState)
  },
);
0.6.9

5 years ago

0.6.8

5 years ago

0.6.7

5 years ago

0.6.6

5 years ago

0.6.5

5 years ago

0.6.4

5 years ago

0.6.3

5 years ago

0.6.2

5 years ago

0.6.1

5 years ago

0.6.0

5 years ago

0.5.7

6 years ago

0.5.6

6 years ago

0.5.5

6 years ago

0.5.4

6 years ago

0.5.3

6 years ago

0.5.2

6 years ago