Coder Social home page Coder Social logo

aurelien-reeves / prodo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from prodo-dev/prodo

0.0 0.0 0.0 4 MB

Prodo is a React framework to build apps faster.

Home Page: https://docs.prodo.dev

License: MIT License

TypeScript 95.06% HTML 0.16% JavaScript 4.53% CSS 0.25%

prodo's Introduction

Prodo

Prodo is a React framework to write performant and scalable web apps with as little boilerplate as possible. View the Documentation. Read more about the motivation behind Prodo on our blog. Join us on Slack!

CircleCI npm version npm version

Key benefits

  • ๐ŸŽ‰ Drastically simplified state management
  • โœจ Absolutely minimal boilerplate, especially compared to Redux
  • โšก๏ธ Blazingly fast re-rendering, similar to MobX
  • ๐Ÿ‘ฏโ€โ™€๏ธ Handles async actions out of the box
  • ๐Ÿ”Ž First class support for TypeScript
  • โœ… Easily testable
  • ๐Ÿš€ Less to learn and shorter ramp up time
  • ๐Ÿ’ช Powerful plugins for routing, local storage, authentication, database, and more...

Show me the code

Define your model:

// src/model.ts
import { createModel } from "@prodo/core";

interface State {
  count: number;
}

export const model = createModel<State>();
export const { state, watch, dispatch } = model.ctx;

Use your state:

// src/index.tsx
import { model, state, dispatch, watch } from "./model";

const changeCount = (amount: number) => {
  state.count += amount;
};

const App = () => (
  <div>
    <button onClick={() => dispatch(changeCount)(-1)}>-</button>
    <h1>Count: {watch(state.count)}</h1>
    <button onClick={() => dispatch(changeCount)(1)}>+</button>
  </div>
);

const { Provider } = model.createStore({
  initState: {
    count: 0,
  },
});

ReactDOM.render(
  <Provider>
    <App />
  </Provider>,
  document.getElementById("root"),
);

As you can see in the above example, the state type was used once and everything else is automatically inferred.

Examples

There are some examples on CodeSandbox that you can view and edit.

There are also many example apps that use Prodo in examples/. We recommend looking at.

Running an example

Navigate to the example directory. For example:

cd examples/todo-app

Install dependencies

yarn

Run development server

yarn start

Navigate to localhost:8080.

Some examples have tests. You can run the tests with

yarn test

How to help?

  • Help us gauge interest by starring this repository if you like what you see!
  • Give feedback by opening an issue.
  • Contribute code by opening a PR. See CONTRIBUTING for information on how to contribute code to the project.

Where to go next?

prodo's People

Contributors

andrejak avatar coffee-cup avatar kprimerakis avatar kwohlfahrt avatar mathieudutour avatar mkamranhamid avatar onurbon avatar sunirmehta avatar tdawes avatar

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.