0.4.0 • Published 8 years ago

herux v0.4.0

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

Herux

Build Status codecov

We look for Flux, Redux and Fluxible and want to take the best parts of them.

We like functional programming, but we like OOP more.

See examples

Main points

  • actions are simple objects with type and data
  • use Context for all operations (actions dispatching, get stores, change listening)
  • keep your data in many dedicated stores
  • you can use static stores (like 'Users') or dynamic stores (like 'Group1', 'Group2' and etc)

Static store

class StaticStore {
    /* some class body */
}

StaticStore.storeType = 'static';
StaticStore.storeName = 'name';
StaticStore.handlers = [
    {
        method: 'methodName',
        type: 'ACTION_TYPE'
    }
];

Dynamic store

class DynamicStore {
    /* some class body */
}

DynamicStore.storeType = 'dynamic';
DynamicStore.storePattern = /^Group\d+$/;
DynamicStore.handlers = [
    {
        method: 'methodName',
        selector: (data) => 'Group' + data.groupId,
        type: 'ACTION_TYPE'
    }
]

Context

  • dispatch(action: Action): void
  • getStore(name: String): Store
  • listen(stores: String[], cb: (stores: Store[]) => void): void
0.4.0

8 years ago

0.3.2

8 years ago

0.3.1

8 years ago

0.3.0

8 years ago

0.2.3

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.1

8 years ago