0.2.1 • Published 2 years ago

@ttws/eric v0.2.1

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

ERIC

ERIC is for Entity React Iterative Component.

It tries to describe hierarchical data as flat maps of entities.

It's like ECS but managed by React, for the following benefits:

  • Shallow React tree meaning updates are mostly local.
    Easier to do hierarchical changes while avoiding rerenders.

  • Mount entity management systems as components.
    Easier to modularize and accurately control lifecycles.

  • Generic entity map structure that can be loaded from HTML
    Easier data scaffolding with template languages

Usage

Declare entities in a html template tag.

deck#root
  card.face-down(suit="clubs" rank="A")
  card(suit="hearts" rank="2")

Declare entity map commands.

export const cmds = {
  count({data, args}){
    return data[args[0]]?.children?.length || 0;
  }
}

Load app.

ERIC.loadEricApp({ template: '#eric-template', cmds });
0.2.1

2 years ago

0.2.0

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago