Lightweight architecture for React
~3000 stargazers
~4000 stargazers
~750 stargazers
Unusable for real apps
For each line of code
you write 1-2 lines of boilerplate
Horrible ecosystem [unlike in React]
Hard to just start developing today
Feels incomplete
actions = Exim.createActions(['work', 'drink'])
People = Exim.createStore
actions: actions
willWork: -> # some
onWork: -> # function
didWork: -> # body
# Alternative form.
eat:
will: -> # goes
on: -> # right
did: -> # here
Users = Exim.createStore
actions: actions
init: ->
meal = friend = food = ''
@update {meal, friend, food}
onEat: (food) ->
@update {meal: 'Brunch', friend: 'Chaplin', food}
onDrink: (drink) ->
@update
meal: 'Brunch'
friend: 'Chaplin'
food: "liquid #{drink}"
# Backed by Users Store
UserView = Exim.createView
mixins: [Exim.connect(Users)]
render: ->
{food, friend, type} = @state
{div, h2} = Exim.DOM
div className: 'user-view',
h2 "Eatr"
div {},
"Eating some #{food} with #{friend} over #{type}"
Sidebar = require('components/sidebar')
{div} = Exim.DOM
# Two-pane layout view with Sidebar component
TwoPane = Exim.createView
render: ->
div className: 'layout',
Sidebar()
@props.activeRouteHandler()
# Define routes
{startHistory, match} = Exim.Router
routes = startHistory
match 'app', App, path: '/',
match 'feedback', FeedbackPage # Each route handler is a React view
match 'terms', TermsPage # @props.activeRouteHandler()
match 'privacy', PrivacyPage # is passed to each view.
match TwoPane,
match 'calendar', Calendar
MessagesRoutes # Easy nesting!
MessagesRoutes = match 'messages', Messages,
match 'new', Compose, path: 'new'
match 'conversation', Conversation, path: ':id'
# Launch app
React.render(routes, document.body)