dpHelper
Last updated
Last updated
Manager | DevTools by Dario Passariello (c)
dpHelper is a precise and complete collection of 190+ tools ready to use in all web/SaaS applications. State and Store Management are now easy, accessible everywhere in your application, including Ajax or React apps, without the need for extra files.
Single Source of Truth: The application's entire state is held within a single object in one store, ensuring consistent and accessible state management throughout the app.
State is flexible: State changes are facilitated exclusively through actions. These actions, which are straightforward JavaScript objects, delineate what has occurred. This methodology ensures that state changes remain predictable.
Changes are made with proxy handle function: To define state changes, dpHelper employs pure functions as intermediaries. These functions accept the current state as input and produce a new state as output, ensuring predictability and ease of testing in the system.
You can see an HTML version where dpHelper and LayerPro work together seamlessly. dpHelper is compatible with a variety of frontend libraries, including:
HTML
React
Vue
And any other frontend library
You can see:
You can see more tutorials, information, and examples about dpHelper clicking here.
Install dpHelper.
or update:
Use it in the main root file (and only there):
or
Note: You don't need to use npm install in this case, or you will get an error.
You can use the state function to store and reuse data throughout your application. Similar to other state managers, you can save state information in JSON format and access it easily in various contexts, including React useEffect and/or dispatch.
For example, you can store a value like this: state.test = 'I am ready' and then retrieve it later using state.test.
example:
You can use the browser's devtools console and type " state.test = 'I am ready' ". Every time you want to use 'test' values, you need just recall state.test.
Note: Observer works only with states. Stores are excluded at the moment.
🔥NEW🔥: Great, now you can use nested objects in observer. You need to declare "state." or "store." before selecting the object you want to monitor.
If you want to run a function every time a state changes, you can use:
You can use it everywhere. Works like "useState" in React but with more flexibility (use one observer for each state!).
When using dpHelper for permanent storage, you should use the store, which stores data persistently across sessions.
Use store for persistent storage: If you want to store data permanently, use store to ensure it is saved in localStorage.
Remove data when necessary: To maintain security, remove stored data when it is no longer needed, such as during logout.
Clear all stored data: Use store.clearAll() to securely remove all stored data from your application.
Type dphelper in the devtool console of your browser to have a look at all available tools that you can use! You can call these from everywhere without import (just one time in the main/root page).
Chrome: Download from Google Web Store
Edge: Download from Microsoft Addons
PS: dpHelper is compatible with all Chromium-based browsers like Brave too!
The dpHelper browser extension allows you to manage your application's dpHelper NPM. Key features include:
Simplified API operations: Easily manage and manipulate data with dpHelper's collection of scripts.
Real-time monitoring: Track memory usage and localStorage to optimize your application's performance.
Stay up-to-date: Receive updates and tips to improve your daily workflow.
Easy installation: Simply import 'dphelper' in your project index to get started.
Global accessibility: All scripts are available globally and can be accessed from anywhere in your application.
MIT - https://en.wikipedia.org/wiki/MIT_License
Dario Passariello - dariopassariello@gmail.com, All rights reserved - Copyright (c) 2019 - 2024