@myrtille/react

An immutable (with immer mutations) one-way state manager without reducers.

Usage no npm install needed!

<script type="module">
  import myrtilleReact from 'https://cdn.skypack.dev/@myrtille/react';
</script>

README

@myrtille/react

React bindings for @myrtille/core or @myrtille/mutate

npm npm bundle size CircleCI Coveralls github

Features

  • 🔄 One-way state manager: your store is the single source of truth
  • 💎 Immutable but feels mutable
  • ⛏️ Hackable
  • 💡 Based on events (actions)
  • 📖 Compatible with redux-devtools

API

  • provider(store: Store) -> Function(React.Component) -> React.Component
  • Provider({ store: Store, children }) -> React.Element
  • useDispatch() -> Function
  • useListeners(listeners: [][(String | Action), Function]) -> void
  • useStateAt(path: String | void) -> Any
  • useStore -> Store
  • Context: React.Context