All Projects β†’ Idered β†’ Behavior Tree

Idered / Behavior Tree

Licence: mit
🌲 Manage React state with Behavior Trees

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Behavior Tree

service-tree
[ABANDONED] A tree that stores services in its node for a given key, and allows traversing them.
Stars: ✭ 33 (-61.18%)
Mutual labels:  tree, state-management
beehive
A flexible, modern, header-only implementation of behavior trees
Stars: ✭ 37 (-56.47%)
Mutual labels:  behavior, tree
Owl Bt
owl-bt is editor for Behavior trees. It has been inspired by Unreal engine behavior trees in a way, that it supports special node items like decorators and services. This makes trees smaller and much more readable.
Stars: ✭ 112 (+31.76%)
Mutual labels:  tree, behavior
Unity-Visual-Behavior-Tree
Reactive Visual Scripting Behavior Tree Tool for Unity 2018.x+
Stars: ✭ 36 (-57.65%)
Mutual labels:  behavior, tree
Mvvm
A Flutter MVVM (Model-View-ViewModel) implementation. It uses property-based data binding to establish a connection between the ViewModel and the View, and drives the View changes through the ViewModel.
Stars: ✭ 80 (-5.88%)
Mutual labels:  state-management
Exploretrees Sg
🌳 Explore Trees in Singapore πŸ‡ΈπŸ‡¬
Stars: ✭ 68 (-20%)
Mutual labels:  tree
Vue State Management Alternative
Vuex state management alternative for both Vue 1.x & 2.x
Stars: ✭ 67 (-21.18%)
Mutual labels:  state-management
Tinspin Indexes
Spatial index library with R*Tree, STR-Tree, Quadtree, CritBit, KD-Tree, CoverTree
Stars: ✭ 64 (-24.71%)
Mutual labels:  tree
Data Structures
This repository contains some data structures implementation in C programming language. I wrote the tutorial posts about these data structures on my personal blog site in Bengali language. If you know Bengali then visit my site
Stars: ✭ 82 (-3.53%)
Mutual labels:  tree
Compare React State Management
React createContext vs Apollo vs MobX vs Redux in a simple todo app.
Stars: ✭ 81 (-4.71%)
Mutual labels:  state-management
Reim
πŸ€” Handle logic in frontend
Stars: ✭ 79 (-7.06%)
Mutual labels:  state-management
Use Combined Reducers
Custom hook to combine all useReducer hooks for one global state container.
Stars: ✭ 69 (-18.82%)
Mutual labels:  state-management
Radon
Object oriented state management solution for front-end development.
Stars: ✭ 80 (-5.88%)
Mutual labels:  state-management
Immutable Treeutils
Functional tree traversal helpers for ImmutableJS data structures
Stars: ✭ 67 (-21.18%)
Mutual labels:  tree
Iflow
Concise & powerful state management framework for Javascript.
Stars: ✭ 81 (-4.71%)
Mutual labels:  state-management
React Composition Api
🎨 Simple React state management. Made with @vue/reactivity and ❀️.
Stars: ✭ 67 (-21.18%)
Mutual labels:  state-management
Puex
(Deprecated) Simple 1kB Vuex alternative
Stars: ✭ 78 (-8.24%)
Mutual labels:  state-management
Hands On Algorithmic Problem Solving
A middle-to-high level algorithm book designed with coding interview at heart!
Stars: ✭ 1,227 (+1343.53%)
Mutual labels:  tree
Pidtree
🚸 Cross platform children list of a PID.
Stars: ✭ 76 (-10.59%)
Mutual labels:  tree
Flutter Boilerplate Project
A boilerplate project created in flutter using MobX and Provider.
Stars: ✭ 1,194 (+1304.71%)
Mutual labels:  state-management

JavaScript/TypeScript implementation of Behavior Trees.

πŸ“• Read the documentation to learn the API.

Gitter

Note: This software is in early development stage. It's not production ready. API may change.

Behavior Tree Toolkit

  • 🌲 @btree/core - Framework agnostic behavior trees implementation
  • βš› @btree/react - Hooks and docs how to use BT with React

Quick start

npm install @btree/core
import {nodes} from '@btree/core'

const initialState = {
  isLoggedIn: false
}

const AuthBehavior = nodes.root('Auth behavior', () =>
  /* Selector runs child one by one until one of them succeeds */
  nodes.selector([
    /* Sequence runs child one by one and stops if any child return failure status */
    nodes.sequence([
      /* Condition node run logic checks on current state */
      nodes.condition('Is logged in', (state, props) => state.isLoggedIn),
      /* Action node is used for side effects and state modifications */
      nodes.action('Redirect to dashboard', (state, props) => {
        navigate('/dashboard')
      }),
    ]),
    nodes.sequence([
      nodes.action('Redirect to login page', () => {
        navigate('/login')
      }),
    ]),
  ])
)

// Create instance of tree
const authTree = AuthBehavior(initialState)

// Run tree logic
authTree.tick()

// You can also run it with props
authTree.tick({authKey: 'xyz'})

Why?

Getting app features done is cool but what about future changes? As time passes, you will forgot how given feature works. Writing comments or docs is not something that developers have in mind all the time. This library will handle that for you.

With Behavior Tree notation all your code will be wrapped with nodes - that allows to visualize how it works. Check /packages/react/example for implementation of this logic.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].