|
| 1 | + <img src="./HeaderBackground.png" alt="Banner"> |
| 2 | + |
| 3 | + > **Spacy**, **Simple**, **Scalable** State Management Framework |
| 4 | + |
| 5 | + <br /> |
| 6 | + |
| 7 | + <a href="https://github.com/agile-ts/agile"> |
| 8 | + <img src="https://img.shields.io/github/license/agile-ts/agile.svg" alt="GitHub License"></a> |
| 9 | +<a href="https://npm.im/@agile-ts/core"> |
| 10 | + <img src="https://img.shields.io/npm/dm/@agile-ts/core.svg" alt="npm monthly downloads"></a> |
| 11 | +<a href="https://npm.im/@agile-ts/core"> |
| 12 | + <img src="https://img.shields.io/npm/dt/@agile-ts/core.svg" alt="npm total downloads"></a> |
| 13 | +<a href="https://npm.im/@agile-ts/core"> |
| 14 | + <img src="https://img.shields.io/bundlephobia/min/@agile-ts/core.svg" alt="npm minified size"></a> |
| 15 | +<a href="https://github.com/agile-ts/agile"> |
| 16 | + <img src="https://img.shields.io/github/languages/code-size/agile-ts/agile.svg" alt="GitHub Code Size"></a> |
| 17 | +<a href="https://github.com/agile-ts/agile"> |
| 18 | + <img src="https://img.shields.io/github/repo-size/agile-ts/agile.svg" alt="GitHub Repo Size"></a> |
| 19 | + |
| 20 | + |
| 21 | +## 🚀 Look how easy it is |
| 22 | +Below example is based on React |
| 23 | +```tsx |
| 24 | +// At first we have to create an Instance of Agile |
| 25 | +const App = new Agile(); |
| 26 | + |
| 27 | +// Now we can create a State which has an initial Value of "Hello Stranger!" |
| 28 | +const MY_FIRST_STATE = App.State("Hello Stranger!"); |
| 29 | + |
| 30 | +// Our cool React Component |
| 31 | +const RandomComponent = () => { |
| 32 | + // With the Hook 'useAgile' we bind the State to our 'RandomComponent' |
| 33 | + const myFirstState = useAgile(MY_FIRST_STATE); // Returns "Hello Stranger!" |
| 34 | + // ^ |
| 35 | + return ( // | |
| 36 | + <div> // | Through the 'set' action the State Value |
| 37 | + <p>{myFirstState}</p> // | gets changed to "Hello Friend!" |
| 38 | + <button // | and causes a rerender on this Component. |
| 39 | + onClick={() => { // | -> myFirstState has the Value "Hello Friend!" |
| 40 | + // Lets's update the State Value // | |
| 41 | + MY_FIRST_STATE.set("Hello Friend!") // ------------- |
| 42 | + }} |
| 43 | + > |
| 44 | + Update State |
| 45 | + </button> |
| 46 | + </div> |
| 47 | + ); |
| 48 | +} |
| 49 | +``` |
| 50 | +_You can't believe the simplicity?! Convince yourself [here](https://codesandbox.io/s/agilets-first-state-f12cz)._ |
| 51 | + |
| 52 | + |
| 53 | +## ❓ Why AgileTs |
| 54 | + |
| 55 | +#### 🚅 Straightforward |
| 56 | +Write minimalistic, boilerplate free code that captures your intent. <br /> |
| 57 | +**For instance** |
| 58 | +- Store State in Local Storage |
| 59 | + ```ts |
| 60 | + MY_STATE.persist("storage-key") |
| 61 | + ``` |
| 62 | +- Reactive Collection of States |
| 63 | + ```ts |
| 64 | + const MY_COLLECTION = App.Collection(); |
| 65 | + MY_COLLECTION.collect({id: 1, name: "Frank"}); |
| 66 | + MY_COLLECTION.collect({id: 2, name: "Dieter"}); |
| 67 | + ``` |
| 68 | +- Cool State checks and mutations |
| 69 | + ```ts |
| 70 | + MY_STATE.undo(); // Undo last change |
| 71 | + MY_STATE.is({hello: "jeff"}); // Check if State has the Value {hello: "jeff"} |
| 72 | + ``` |
| 73 | + |
| 74 | +#### 🤸 Flexible |
| 75 | +Agile can be used in nearly every UI-Framework |
| 76 | +and surly works with the workflow that suits you best, |
| 77 | +since Agile isn't bound to _dispatches_, _reducers_, .. |
| 78 | + |
| 79 | +#### 🎯 Easy to Use |
| 80 | +Learn the powerful and simple tools of Agile in a short amount of time. |
| 81 | + |
| 82 | +#### ⛳️ Centralize |
| 83 | +Manage your Application Logic outside of any UI-Framework in a central place. |
| 84 | +This makes your code more decoupled, portable, and above all, easily testable. |
| 85 | + |
| 86 | +#### 🍃 Lightweight |
| 87 | +Agile has an unpacked size of [52.7kB ](https://bundlephobia.com/result?p=@agile-ts/[email protected]) |
| 88 | +and [0 dependencies](https://www.npmjs.com/package/@agile-ts/core). |
| 89 | + |
| 90 | + |
| 91 | +## ⬇️ Installation |
| 92 | +``` |
| 93 | +npm install @agile-ts/core |
| 94 | +``` |
| 95 | +To use Agile we have to install the _core_ package, it's the brain and handles your States, Collections, .. |
| 96 | +<br /> |
| 97 | +``` |
| 98 | +npm install @agile-ts/react |
| 99 | +``` |
| 100 | +In addition, we need to install a _fitting integration_ for the Framework we are using.. in my case [React](https://www.npmjs.com/package/@agile-ts/react). |
| 101 | + |
| 102 | + |
| 103 | +## 📄 Documentation |
| 104 | +The Agile Docs are located [here](https://agile-ts.org/docs/) |
| 105 | + |
| 106 | + |
| 107 | +## 🗂 Packages of Agile |
| 108 | +| Name | Latest Version | Description | |
| 109 | +| ------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------- | |
| 110 | +| [@agile-ts/core](/packages/core) | [](https://www.npmjs.com/package/@agile-ts/core) | Brain of Agile | |
| 111 | +| [@agile-ts/react](/packages/react) | [](https://www.npmjs.com/package/@agile-ts/react) | React Integration | |
| 112 | +| [@agile-ts/api](/packages/api) | [](https://www.npmjs.com/package/@agile-ts/api) | Promise based Api | |
| 113 | +| [@agile-ts/multieditor](/packages/multieditor) | [](https://www.npmjs.com/package/@agile-ts/multieditor) | Simple Form Manager | |
| 114 | + |
| 115 | + |
| 116 | +## 👨💻 Contribute |
| 117 | +Feel free to contribute |
| 118 | + |
| 119 | + |
| 120 | +## 🌠 Credits |
| 121 | +AgileTs is inspired by [PulseJs](https://github.com/pulse-framework/pulse) |
0 commit comments