Skip to content
forked from plusnew/core

Component Framework - with a typesecure and functional approach

License

Notifications You must be signed in to change notification settings

gaggala/plusnew

 
 

Repository files navigation

plusnew Build Status Coverage Status

A typesecure framework for managing your components. The Framework has a immutable statehandling approach, which allows easy timetraveling.

A Component can get data by it's props, and by unlimited internal and external stores. This avoids nesting the component in containers for i18n and others.

import plusnew, { component, store } from 'plusnew';
import Counter from './Counter';

const INITIAL_COUNTER_VALUE = 0;

export default component(
  // Function who returns all dependencies, when the component should rerender
  () => ({ counter:  store(INITIAL_COUNTER_VALUE, state: number => state + 1) }),

  // The actual stateless renderfunction
  (props: {}, { counter }) =>
    <div>
      <button
        onclick={(evt: MouseEvent) => counter.dispatch()}
      />
      <Counter value={counter.state} />
    </div>,
);

About

Component Framework - with a typesecure and functional approach

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 96.3%
  • JavaScript 3.7%