All Projects → superMDguy → tuxi

superMDguy / tuxi

Licence: MIT license
✨ White glove service for your async needs

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to tuxi

random-users-details
Random Users details in flutter from randomusers api
Stars: ✭ 14 (+0%)
Mutual labels:  state-management
react-state
React-State - Superpowers for managing local and reusable state in React
Stars: ✭ 14 (+0%)
Mutual labels:  state-management
service-tree
[ABANDONED] A tree that stores services in its node for a given key, and allows traversing them.
Stars: ✭ 33 (+135.71%)
Mutual labels:  state-management
Cyanic
Declarative, state-driven UI framework
Stars: ✭ 32 (+128.57%)
Mutual labels:  state-management
xoid
Framework-agnostic state management library designed for simplicity and scalability ⚛
Stars: ✭ 96 (+585.71%)
Mutual labels:  state-management
rematch
The Redux Framework
Stars: ✭ 8,340 (+59471.43%)
Mutual labels:  state-management
enform
Handle React forms with joy 🍿
Stars: ✭ 38 (+171.43%)
Mutual labels:  state-management
swr-internal-state
Use SWR to manage app's internal state
Stars: ✭ 32 (+128.57%)
Mutual labels:  state-management
vuse-rx
Vue 3 + rxjs = ❤
Stars: ✭ 52 (+271.43%)
Mutual labels:  state-management
vana
Observe your immutable state trees 🌲👀 (great with React)
Stars: ✭ 24 (+71.43%)
Mutual labels:  state-management
flutter-provider-architecture
⚖️ A Flutter Architecture for small/medium/large/big large scale using Provider as State Management with Get It!
Stars: ✭ 81 (+478.57%)
Mutual labels:  state-management
stater
collection of Clojure/Script mount apps
Stars: ✭ 29 (+107.14%)
Mutual labels:  state-management
magnetar
A framework-agnostic syncing solution that auto-connects any DB/API with your local data store and has optimistic-UI built in 🌟
Stars: ✭ 36 (+157.14%)
Mutual labels:  state-management
vue-class-state
面向对象风格的vue状态管理
Stars: ✭ 14 (+0%)
Mutual labels:  state-management
ng-effects
Reactivity system for Angular. https://ngfx.io
Stars: ✭ 46 (+228.57%)
Mutual labels:  state-management
react-context
(つ°ヮ°)つ Understanding React Context
Stars: ✭ 11 (-21.43%)
Mutual labels:  state-management
mobius.kt
Kotlin Multiplatform framework for managing state evolution and side-effects
Stars: ✭ 39 (+178.57%)
Mutual labels:  state-management
screenmanager
Stackable Screen/State Management for the LÖVE framework.
Stars: ✭ 29 (+107.14%)
Mutual labels:  state-management
Accounting
A simple accounting app that provides basic additions, deletions, modifications, and provides a simple summary page, which is implemented by using MVI pattern.
Stars: ✭ 30 (+114.29%)
Mutual labels:  state-management
onli-reducer
⚛️ One line reducer. State management without boilerplate.
Stars: ✭ 31 (+121.43%)
Mutual labels:  state-management

CircleCI CodeCov NPM Version License PRs Welcome

Tuxi

White glove service for your async needs

Tuxi automatically manages the state of asynchronous tasks, so you don't have to. No more setting isLoading after every api request! 😌. For more details about the motivation for tuxi, check out this article I wrote.

Installing

NPM

npm install --save tuxi

CDN

Tuxi can also be used directly in the browser through a babel-transpiled and minified build hosted on unpkg:

<script src="https://unpkg.com/tuxi">

Examples

For complete documentation and more examples, see the docs folder.

Pure JavaScript

import tuxi from 'tuxi'
import api from './api'

const articlesTask = tuxi.task(api.fetchArticles)

// ⚡ Fire the api call
articlesTask.start()

// The task is immediately set to pending
console.log(articlesTask.pending) // true

// 🌀 The spinning property has a configurable delay
setTimeout(() => console.log(articlesTask.spinning), 1500) // true

// After a while...
console.log(articlesTask.hasValue) // true
console.log(articlesTask.value) // ['New Planet Discovered!', '17 Surprising Superfoods!', ...]

Vue

import tuxi from 'tuxi'
import tuxiVue from 'tuxi/plugins/vue'
import api from './api'

tuxi.use(tuxiVue())

export default {
  data() {
    return {
      articlesTask: tuxi.task(api.fetchArticles)
    }
  },

  computed: {
    articles() {
      return this.articlesTask.value
    }
  }
}
<div class="wrapper">
  <div class="empty-message" v-if="articlesTask.empty">
    No articles
  </div>

  <div class="spinner" v-if="articlesTask.spinning">
    Loading articles...
  </div>

  <div class="error-message" v-if="articlesTask.error">
    {{ articlesTask.error.message }}
  </div>

  <ul v-if="articlesTask.hasValue">
    <li v-for="article in articles">
      {{ article.title }}
    </li>
  </ul>

  <button @click="articlesTask.start()">Load Articles</button>
</div>

Contributing

Tuxi is still being actively developed, so any suggestions or contributions are appreciated. I'm still not 100% sure about the API, so comments on how to make it cleaner/simpler are welcome. That said though, I think it's definitely ready to be used for non mission critical applications.

Logo made by freepik from www.flaticon.com

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].