0.3.1 • Published 6 years ago

@mcrowe/reapp v0.3.1

Weekly downloads
1
License
ISC
Repository
github
Last release
6 years ago

Reapp

Reapp is a simple state-management and routing library for React. It intentionally defies "best-practices" in order to make apps easy to build without losing the ability to architect large apps well.

  • State is stored in stores which are mutated (shutter!)
  • Routing is done without update the url, or handling back gracefully (oh no!)
  • The entire app is refreshed every time a store is updated (gasp!)

Usage

npm install @mcrowe/reapp --save

import { Store, Router, subscribe } from '@mcrowe/reapp'
import App from './app'
import Home from './scenes'
import Page from './scenes'


// Use "Store" for a subscribable data store
const store = new Store({counter: 5})

store.get().counter // 5

// Update the store and broadcast changes
store.update(v =>
  v.counter += 1
)

store.get().counter = 7
store.set() // broadcast changes outside of a broadcast


// Use "Router" to handle navigation
const router = new Router({path: 'home', params: {}})

router.route('home', App)
router.route('page', Page)

router.push('page', {id: 5})
router.pop()

router.getCurrentRoute() // {path: 'home', params: {}}


// Use "subscribe" to subscribe any component to changes
// in one or more "ISubscribable" (router, store, ...)
const SubscribedApp = subscribe(router, store)(App)

Development

Install npm modules:

npm install

Run tests:

npm test

Release

Release a new version:

bin/release.sh

This will publish a new version to npm, as well as push a new tag up to github.

0.3.1

6 years ago

0.3.0

6 years ago

0.2.9

6 years ago

0.2.8

6 years ago

0.2.7

6 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago