User:Trishanthnaidu/sandbox

= Introduction = Rootz JS (also known as Rootz or rootz.js) is a centralized state management tool for React applications. It follows a structural-functional paradigm, which sees your application as a set of Nodes (Not to be confused with Node JS) interconnected through definitive set of actions, defined during the application building process. Each action defines the change of state of the Node. All the Nodes abide by these actions resulting into expected application's behavior.

Rootz shadows most of the functionalities and provides access to only those which are required for handling the state. This makes it easier for the user to rapidly build complex applications with lesser Lines Of Code (LOC). Rootz smartly skips the boilerplate code by predefining them during the creation of Nodes(Not to be confused with Node JS), which otherwise the user may end up writing. This increases the LOC to the functionality ratio without compromising the code quality and complexity.

This makes it easy to manage the state of your application. It's not only light on your pocket, but also helps in solving application's structural complexities for maintaining state.

Basic Usage
The following is an example of Rootz usage with React application.

components/Message.jsx
In the above example the component  receives   as props called as NodeProps. These props are defined within its Node,.

The state would get  as initial state along with   as actions. On click of the button the state object would get updated to ."Note: The function  in   object is generated by the Action Generators."

Components
A component in Rootz can be a React class or a Functional component with a pre-defined object passed as props, known as NodeProps. The props object for the component is defined by Rootz and have properties which help in accessing the defined functionalities.

Link: Components

Node
Node exists as an interactive layer between Root and the Components. It acts as a controller for the components. A Node provides dynamic nature to a components. It provides functionality to define the initial state of the Node. Additionally a Node also provides functionalities to manage the change in state through actions and contract. Methods like  and   helps in managing the change in state of the Node.

Link: Node

State
State are simple JavaScript objects. In a React-Rootz app state are centrally stored and maintained within the State Container. As other properties of NodeProps,  too is initialized within a Node. Initializing a state can be done through.

Link: State

Actions
Actions describe the events occuring in an application. These events serves an intention to interact with the app and request changes. This means change in the existing state of the application. Rootz provides inbuilt boilerplate methods to create actions, which otherwise had to be created by the user.

Actions should always return serializable plain objects. These objects are then merged to the existing state, forming a new updated state object. In simple ways actions are the modes of interaction with the application.

Link: Actions

Contract
are actions with different intentions. are intended to update the state in which it is defined. While a contract can update the state of any Node defined within an application.

It's still an action by nature
If contracts and actions have such a small difference then why call it contract and not actions? This is because the term "contract" self explains its purpose of having an agreement. This agreement can be between two or more nodes. Conceptually the node which initiates the update is called as the contractee while the one who receives the update is called the contractor. These terms are basically to understand the connections and differentiate them from one another.

Link: Contract

nodes/HandleMessage.js
"Note: In the above example a different Node, is trying to update the  . An Example of updating the state of one component from another."

Profile
Profile is similar to the concept of Bus in Networks. It helps you to store application specific generic data which could be accessible at any point within the application execution.

Profile provides simple  and   to set and retrieve the data. You can compare it to the concept of  in React, with a little more advantage of having it centrally stored and managed.

Link: Profile

Devtools
We are looking forward to develop our custom Devtools which would provide unmatched debugging experience and a different perspective to see your application in action.

History
Rootz is built by Trishanth Naidu, a Software Engineer at Disney. The concept of Structural Functionalism struck out to be the core inspiration behind coming up with an alternative to then existing state management libraries. This idea was different and did not go with other libraries in the market extending the Context API. Rootz uses core functional programming patterns as well as the React setState API to provide a tool for managing application state.

Official Website
https://rootzjs.org