# anysolve

> This package is my professional structure and I will try to make all the logic in this package.

Latest version **1.9.1** (published 2023-06-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install anysolve
pnpm add anysolve
yarn add anysolve
bun add anysolve
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.9.1 |
| Published | 2023-06-30 |
| First published | 2023-01-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 64 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Asadulloh Sadirdinov |
| Maintainers | asadullohpro |

## Links

- npm: https://www.npmjs.com/package/anysolve
- Repository: https://github.com/Asadulloh-pro/anysolve
- Homepage: https://anysolve.uz/
- Issues: https://github.com/Asadulloh-pro/anysolve/issues
- npm.io page: https://npm.io/package/anysolve

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ^1.2.1
- [zustand](https://npm.io/package/zustand.md) ^4.1.5

## Recent versions

- 1.9.1 (latest) — 2023-06-30
- 1.8.1 — 2023-04-26
- 1.8.0 — 2023-04-26
- 1.7.9 — 2023-04-12
- 1.7.8 — 2023-04-12
- 1.7.7 — 2023-04-07
- 1.6.7 — 2023-04-05
- 1.5.7 — 2023-04-05
- 1.4.7 — 2023-04-05
- 1.4.6 — 2023-04-03
- 1.4.5 — 2023-04-03
- 1.4.4 — 2023-04-03
- 0.4.4 — 2023-03-30
- 0.4.3 — 2023-03-30
- 0.4.2 — 2023-02-10
- … 6 more at https://npm.io/package/anysolve/versions

## README

# Anysolve

`$ npm install anysolve axios zustand`

### useAllStore (Zustand)

```javascript
// export module types
export type modulesType = {
  customers: CustomersStoreType;
  itemServices: ItemServicesStoreType;
  news: NewsStoreType;
};


export type allT =
  | CustomersStoreType
  | ItemServicesStoreType
  | NewsStoreType

import { StoreApi, UseBoundStore } from "zustand";
  // export module stores
export default const useAllStore = (
  type: keyof modulesType
): UseBoundStore<StoreApi<allT>> => {
  switch (type) {
    case "customers":
// return customers store
      return useCustomersStore;
    case "itemServices":
      return useServicesStore;
    case "news":
      return useNewsStore;
  }
};
```

### Dialog store
```javascript
const useDialog = create<DeleteDialog>()((set) => ({
  deleteInfo: {
    isOpen: false,
  },
  setDeleteInfo: (deleteInfo: Delete) => set(() => ({ deleteInfo })),
}));

export default useDialog;
```

### Main class
```javascript
// apiURLs - object which return modules {name: url}
const apiURLs: {
  [P in keyof modulesType]: string;
} = {
  customers: "customers",
  itemServices: "product",
  news: "news",
};

export class Aos extends BaseAos<modulesType> {
  constructor() {
    super({
      apiUrls: apiURLs,
      services: {
        messageConfig: {
// messageAlert function which return Snakebar (message, type: "danger" | "succes") =>
          messageAlert: messageAlert,
        },
        baseUrl: "https://baseURL",
      },
      store: useAllStore,
//store which
      useDialog: useDialog,
    });
  }
}
```

---
_Source: https://npm.io/package/anysolve · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
