GithubHelp home page GithubHelp logo

steveruizok / state-designer Goto Github PK

View Code? Open in Web Editor NEW
640.0 14.0 23.0 6.98 MB

State management with statecharts.

Home Page: https://state-designer.com

License: MIT License

TypeScript 27.87% JavaScript 12.85% CSS 11.87% HTML 47.41%
react typescript statecharts

state-designer's Introduction

State Designer

State Designer is a JavaScript and TypeScript library for managing the state of a user interface. It prioritizes the design experience, making it easy to experiment with ideas, iterate on solutions, and communicate the final result.

Features

  • Write state-charts in a simple declarative syntax.
  • Create both global and local component states.
  • Use selectors to subscribe to just the data you need.

Packages

Usage

Using State Designer involves three steps:

  1. Create a state with a configuration object.
  2. Subscribe to the state's updates.
  3. Send events to the state.

Your exact usage will depend on your framework:

Inspiration

State Designer is heavily inspired by xstate. Note that, unlike xstate, State Designer does not adhere to the scxml spec.

Author

License

MIT

state-designer's People

Contributors

dependabot[bot] avatar jyash97 avatar steveruizok avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

state-designer's Issues

state designer core has missing dependencies

I tried to use @state-designer/core v2.0.3 (the latest as of this post) and found that two dependencies were missing, lodash and immer. I installed these myself and it worked.

I was confused because this codesandbox example of state designer with vanilla JS worked, but when I updated the state designer dependency to 2.0.3, it shows the missing dependency error, you can see that reproduced in this sandbox.

Just wanted to let you know, I'm excited to try using state designer with Imba, its working nicely so far.

Accessing values in actions

action: (data, payload) => {..

Unless I'm missing it, it's currently not possible to access computed values in actions. Is that by design?
It's not a big issue since values are pure functions anyways, but it might be a bit cleaner to have access to them in here somehow.

Using wrong method name in a Sandbox example

Hi Stev,

In the tip box of this link, there's a Sandbox example where it has the following lines which are not correct:

import { createStateDesigner, useStateDesigner } from "@state-designer/react"

// [1]
const counter = createStateDesigner({
	data: { count: 0 },
	on: { CLICKED: data => data.count++ },
})

I suggest replacing them with the following lines so the example would work:

import {  useStateDesigner } from "@state-designer/react"
import { createState } from "@state-designer/core"
// [1]
const counter = createState({
	data: { count: 0 },
	on: { CLICKED: data => data.count++ },
})

P.S. I would like to thank you so much for your packages and for your creativity <3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.