npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dashadmin/dash-admin-state

v1.3.25

Published

DashAdminState is a redux helper for essential data that requires to be shared across the Dash Admin application.

Readme

DASH ADMIN STATE

DashAdminState is a redux helper for essential data that requires to be shared across the Dash Admin application.

The redux store is structured as follows, many of this stores are internally used by DashAdmin, while others such as common state could be interfaced and configured at a domain application level.

  • IDashAdminState Key State Interfaces:
    • IAuthState: Manages authentication state with user and auth data
    • ICommonState: Handles common app state like loading, errors, navigation
    • IPageState: Controls page-level state like title and icons
    • ISettingsState: Manages app settings like theme, layout, locale
    • IDASHAppState: Root state interface combining all state slices
    • IFormDataState: Tracks form modification state

IMPLEMENTATION EXAMPLE

The library imported at the DashApp entrypoint; your Domain/App.tsx

import { IDASHAppState } from 'dash-admin-state';

General

The key implementation points:

Initial state must be defined in the App Entrypoint (App.tsx)

const INITIAL_APP_STATE: IDASHAppState<IDomainUser, IDomainAuth, IAppResourceConfig>

The initial state are passed to the DashAdmin component

<DASHAdmin<U, A, R, C>
	...
	initialAppState={INITIAL_APP_STATE}
	...

Specific considerations

Define the interfaces that will store your user data

While technically the User and Auth could be similar, User interface commonly will include only basic user data such as user id and name returned by the user login and user endpoint, while the Auth interface relies in the response of the getAuth api endpoint which architecturally returns additional or extra user data.

export interface IDomainUser {...}
export interface IDomainAuth {...}

const INITIAL_APP_STATE: IDASHAppState<
	IDomainUser,
	IDomainAuth,
	IAppResourceConfig
> = {
	page: defaultPageSettings,
	settings: defaultSettings,
	auth: defaultAuth,
	common: defaultCommon,
	resources: defaultResources,
  formData: defaultFormState
};

<DASHAdmin<IDomainUser, IDomainAuth, IDashAutoAdminResourceConfig, IDASHAppConstants>
	...
	initialAppState={INITIAL_APP_STATE}
	...

Notes

  • Note that they can also be technically defined as 'any'
  • User and Auth state are considered to be deprecated int he future from DashAdminState in favor of AutoAdmin AuthContext.

USAGE EXAMPLE - ACCESSING STATE

In your components

Import settings

  import { IDASHAppState } from 'dash-admin-state';

	const settings: ISettingsState = useSelector(
		(state: IDASHAppState) => state.settings,
	);

Get DashAdmin Resources


import { IDASHAppState } from 'dash-admin-state';

const resources = useSelector(
		(
			state: IDASHAppState<IDomainUser, IDomainAuth, IAppResourceConfig>,
		) => {
			if (debug || menu) {
				return menu;
			}
			return state.resources.items;
		},
	);
 const formData = useSelector(
		(
			state: IDASHAppState<any, any, IDashAutoAdminResourceConfig>,
		) => {

			return state.formData;
		},
	);

UPDATING VALUES

import { DASH_REDUX_ACTIONS } from 'dash-admin-state';

  ...
	const dispatch = useDispatch();
  dispatch(DASH_REDUX_ACTIONS.toggleExpandedSideNav(true));
  ...

DASH_REDUX_ACTIONS

TODO:

  • Some methods are implemented in the DASH_REDUX_ACTIONS
  • Implement generic methods to update each store