@astral/mobx-query 1.9.0 → 1.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -653,9 +653,9 @@ docQuery.forceUpdate({ name: 'test' });
653
653
  Для мокинга QuerySet и InfiniteQuerySet необходимо использовать mock следующего вида:
654
654
  ```ts
655
655
  type Fetcher = {
656
- queries: QuerySet<any[], any>;
657
- infiniteQueries: InfiniteQuerySet<any[], any>;
658
- mutations: MutationSet<any[], any>;
656
+ queries: Record<string, QuerySet<any[], any>>;
657
+ infiniteQueries: Record<InfiniteQuerySet<any[], any>>;
658
+ mutations: Record<MutationSet<any[], any>>;
659
659
  };
660
660
 
661
661
  const mockFetcher = <TFetcher extends Fetcher>(config: DeepPartial<TFetcher>) => config as TFetcher;
@@ -1,4 +1,4 @@
1
- import isPlainObj from 'is-plain-obj';
1
+ import { isPlainObject } from '@astral/utils';
2
2
  /**
3
3
  * Создает ключи на основе каждого параметра
4
4
  * @param additionalKeys - Создает для каждого параметра отдельный ключ, чтобы по нему можно было инвалидировать query
@@ -9,7 +9,7 @@ import isPlainObj from 'is-plain-obj';
9
9
  export const generateQuerySetKeys = (baseKey, params) => {
10
10
  const resultKeys = [];
11
11
  params.forEach((param) => {
12
- if (isPlainObj(param)) {
12
+ if (isPlainObject(param)) {
13
13
  resultKeys.push(...Object.entries(param).map(([key, value]) => [baseKey, key, value]));
14
14
  }
15
15
  else {
@@ -1,10 +1,7 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.generateQuerySetKeys = void 0;
7
- const is_plain_obj_1 = __importDefault(require("is-plain-obj"));
4
+ const utils_1 = require("@astral/utils");
8
5
  /**
9
6
  * Создает ключи на основе каждого параметра
10
7
  * @param additionalKeys - Создает для каждого параметра отдельный ключ, чтобы по нему можно было инвалидировать query
@@ -15,7 +12,7 @@ const is_plain_obj_1 = __importDefault(require("is-plain-obj"));
15
12
  const generateQuerySetKeys = (baseKey, params) => {
16
13
  const resultKeys = [];
17
14
  params.forEach((param) => {
18
- if ((0, is_plain_obj_1.default)(param)) {
15
+ if ((0, utils_1.isPlainObject)(param)) {
19
16
  resultKeys.push(...Object.entries(param).map(([key, value]) => [baseKey, key, value]));
20
17
  }
21
18
  else {
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@astral/mobx-query",
3
- "version": "1.9.0",
3
+ "version": "1.10.1",
4
4
  "browser": "./index.js",
5
5
  "main": "./node/index.js",
6
6
  "dependencies": {
7
+ "@astral/utils": "^1.6.1",
8
+ "@emotion/hash": "0.9.2",
7
9
  "mobx": "^6.9.0",
8
- "is-plain-obj": "4.1.0",
9
- "utility-types": "3.11.0",
10
- "@emotion/hash": "0.9.2"
10
+ "utility-types": "3.11.0"
11
11
  },
12
12
  "author": "Astral.Soft",
13
13
  "license": "MIT",