8000 GitHub - feeblejs/feeble: A React/Redux Architecture · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Oct 16, 2023. It is now read-only.
feeblejsPublic archive

About

A React/Redux Architecture

Topics

Resources

Stars

72 stars< 8000 /div>

Watchers

1 watching

Forks

Latest commit

 

History

173 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
< 8000 svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom">
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Feeble

React + Redux Architecture

Introduction

Feeble is a framework built on top of React/Redux/redux-observable which aims to make building React/Redux applications easier and better.

If you are familiar with React/Redux/redux-observable, you'll love Feeble 🙈.

Installation

npm install feeble --save

Example

import React from 'react'
import ReactDOM from 'react-dom'
import feeble, { connect } from 'feeble'

// 1. Create a app
const app = feeble()

// 2.1 Create model
const counter = feeble.model({
  namespace: 'count',
  state: 0,
})

// 2.2 Create action creators
counter.action('increment')
counter.action('decrement')

// 2.3 Create reducer
counter.reducer(on => {
  on(counter.increment, state => state + 1)
  on(counter.decrement, state => state - 1)
})

// 2.4 Attach model to the app
app.model(counter)

// 3. Create view
const App = connect(({ count }) => ({
  count
}))(function({ dispatch, count }) {
  return (
    <div>
      <h2>{ count }</h2>
      <button key="inc" onClick={() => { dispatch(counter.increment()) }}>+</button>
      <button key="dec" onClick={() => { dispatch(counter.decrement()) }}>-</button>
    </div>
  )
})

// 4. Mount the view
const tree = app.mount(<App />)

// 5. Render to DOM
ReactDOM.render(tree, document.getElementById('root'))

For more complex examples, please see /examples.

Documentation

https://feeblejs.gith 5B1F ub.io/feeble

License

MIT

About

A React/Redux Architecture

Topics

Resources

Stars

72 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages

0