synapse-storage 2.1.1 → 3.0.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/dist/_utils/index.js +3 -3
- package/dist/api/api.module.js +3 -3
- package/dist/api/example.js +2 -2
- package/dist/api/index.js +5 -5
- package/dist/api/utils/endpoint-headers.js +1 -1
- package/dist/api/utils/fetch-base-query.js +1 -1
- package/dist/core/index.js +2 -2
- package/dist/core/selector/index.js +1 -1
- package/dist/core/storage/adapters/base-storage.service.js +1 -1
- package/dist/core/storage/adapters/indexed-DB.service.js +2 -2
- package/dist/core/storage/adapters/indexed-DB.service.old.js +2 -2
- package/dist/core/storage/adapters/local-storage.service.js +2 -2
- package/dist/core/storage/adapters/memory-storage.service.js +2 -2
- package/dist/core/storage/index.js +9 -9
- package/dist/core/storage/middlewares/index.js +1 -1
- package/dist/core/storage/utils/cache.util.js +1 -1
- package/dist/index.js +5 -9
- package/dist/index.js.map +1 -1
- package/dist/react/hooks/index.js +2 -2
- package/dist/react/index.js +2 -2
- package/dist/react/utils/createSynapseCtx.d.ts.map +1 -1
- package/dist/react/utils/createSynapseCtx.js.map +1 -1
- package/dist/react/utils/index.js +1 -1
- package/dist/reactive/dispatcher/index.js +2 -2
- package/dist/reactive/dispatcher/middlewares/index.js +1 -1
- package/dist/reactive/effects/effects.module.js +1 -1
- package/dist/reactive/effects/index.js +1 -1
- package/dist/reactive/effects/utils/index.js +2 -2
- package/dist/reactive/index.js +2 -2
- package/dist/utils/index.js +1 -1
- package/package.json +2 -2
- package/dist/_examples/_example5.d.ts +0 -1
- package/dist/_examples/_example5.d.ts.map +0 -1
- package/dist/_examples/_example5.js +0 -184
- package/dist/_examples/_example5.js.map +0 -1
- package/dist/_examples/_example6.d.ts +0 -1
- package/dist/_examples/_example6.d.ts.map +0 -1
- package/dist/_examples/_example6.js +0 -168
- package/dist/_examples/_example6.js.map +0 -1
- package/dist/_examples/example1.d.ts +0 -1
- package/dist/_examples/example1.d.ts.map +0 -1
- package/dist/_examples/example1.js +0 -240
- package/dist/_examples/example1.js.map +0 -1
- package/dist/_examples/example2.d.ts +0 -1
- package/dist/_examples/example2.d.ts.map +0 -1
- package/dist/_examples/example2.js +0 -81
- package/dist/_examples/example2.js.map +0 -1
- package/dist/_examples/example3.d.ts +0 -1
- package/dist/_examples/example3.d.ts.map +0 -1
- package/dist/_examples/example3.js +0 -99
- package/dist/_examples/example3.js.map +0 -1
- package/dist/_examples/example4.d.ts +0 -1
- package/dist/_examples/example4.d.ts.map +0 -1
- package/dist/_examples/example4.js +0 -172
- package/dist/_examples/example4.js.map +0 -1
- package/dist/_examples/example5.d.ts +0 -1
- package/dist/_examples/example5.d.ts.map +0 -1
- package/dist/_examples/example5.js +0 -184
- package/dist/_examples/example5.js.map +0 -1
- package/dist/_examples/example6.d.ts +0 -1
- package/dist/_examples/example6.d.ts.map +0 -1
- package/dist/_examples/example6.js +0 -168
- package/dist/_examples/example6.js.map +0 -1
- package/dist/_examples/plugins.d.ts +0 -1
- package/dist/_examples/plugins.d.ts.map +0 -1
- package/dist/_examples/plugins.js +0 -176
- package/dist/_examples/plugins.js.map +0 -1
- package/dist/_examples/pokemons/PokemonList.d.ts +0 -5
- package/dist/_examples/pokemons/PokemonList.d.ts.map +0 -1
- package/dist/_examples/pokemons/PokemonList.js +0 -166
- package/dist/_examples/pokemons/PokemonList.js.map +0 -1
- package/dist/_examples/pokemons/api.d.ts +0 -8
- package/dist/_examples/pokemons/api.d.ts.map +0 -1
- package/dist/_examples/pokemons/api.js +0 -45
- package/dist/_examples/pokemons/api.js.map +0 -1
- package/dist/_examples/pokemons/app.config.d.ts +0 -15
- package/dist/_examples/pokemons/app.config.d.ts.map +0 -1
- package/dist/_examples/pokemons/app.config.js +0 -15
- package/dist/_examples/pokemons/app.config.js.map +0 -1
- package/dist/_examples/pokemons/dispatchers/pokemon.dispatcher.d.ts +0 -9
- package/dist/_examples/pokemons/dispatchers/pokemon.dispatcher.d.ts.map +0 -1
- package/dist/_examples/pokemons/dispatchers/pokemon.dispatcher.js +0 -122
- package/dist/_examples/pokemons/dispatchers/pokemon.dispatcher.js.map +0 -1
- package/dist/_examples/pokemons/effects/pokemon.effects.d.ts +0 -16
- package/dist/_examples/pokemons/effects/pokemon.effects.d.ts.map +0 -1
- package/dist/_examples/pokemons/effects/pokemon.effects.js +0 -39
- package/dist/_examples/pokemons/effects/pokemon.effects.js.map +0 -1
- package/dist/_examples/pokemons/middlewares/pokenon.middlewares.d.ts +0 -4
- package/dist/_examples/pokemons/middlewares/pokenon.middlewares.d.ts.map +0 -1
- package/dist/_examples/pokemons/middlewares/pokenon.middlewares.js +0 -27
- package/dist/_examples/pokemons/middlewares/pokenon.middlewares.js.map +0 -1
- package/dist/_examples/pokemons/pokemon.dispatcher.d.ts +0 -9
- package/dist/_examples/pokemons/pokemon.dispatcher.d.ts.map +0 -1
- package/dist/_examples/pokemons/pokemon.dispatcher.js +0 -122
- package/dist/_examples/pokemons/pokemon.dispatcher.js.map +0 -1
- package/dist/_examples/pokemons/pokemon.effects.d.ts +0 -5
- package/dist/_examples/pokemons/pokemon.effects.d.ts.map +0 -1
- package/dist/_examples/pokemons/pokemon.effects.js +0 -39
- package/dist/_examples/pokemons/pokemon.effects.js.map +0 -1
- package/dist/_examples/pokemons/pokemon.selectors.d.ts +0 -5
- package/dist/_examples/pokemons/pokemon.selectors.d.ts.map +0 -1
- package/dist/_examples/pokemons/pokemon.selectors.js +0 -10
- package/dist/_examples/pokemons/pokemon.selectors.js.map +0 -1
- package/dist/_examples/pokemons/pokemon.storage.d.ts +0 -3
- package/dist/_examples/pokemons/pokemon.storage.d.ts.map +0 -1
- package/dist/_examples/pokemons/pokemon.storage.js +0 -14
- package/dist/_examples/pokemons/pokemon.storage.js.map +0 -1
- package/dist/_examples/pokemons/pokemon1.selectors.d.ts +0 -5
- package/dist/_examples/pokemons/pokemon1.selectors.d.ts.map +0 -1
- package/dist/_examples/pokemons/pokemon1.selectors.js +0 -8
- package/dist/_examples/pokemons/pokemon1.selectors.js.map +0 -1
- package/dist/_examples/pokemons/pokenon.middlewares.d.ts +0 -4
- package/dist/_examples/pokemons/pokenon.middlewares.d.ts.map +0 -1
- package/dist/_examples/pokemons/pokenon.middlewares.js +0 -27
- package/dist/_examples/pokemons/pokenon.middlewares.js.map +0 -1
- package/dist/_examples/pokemons/selectors/pokemon.selectors.d.ts +0 -5
- package/dist/_examples/pokemons/selectors/pokemon.selectors.d.ts.map +0 -1
- package/dist/_examples/pokemons/selectors/pokemon.selectors.js +0 -10
- package/dist/_examples/pokemons/selectors/pokemon.selectors.js.map +0 -1
- package/dist/_examples/pokemons/selectors/pokemon1.selectors.d.ts +0 -5
- package/dist/_examples/pokemons/selectors/pokemon1.selectors.d.ts.map +0 -1
- package/dist/_examples/pokemons/selectors/pokemon1.selectors.js +0 -8
- package/dist/_examples/pokemons/selectors/pokemon1.selectors.js.map +0 -1
- package/dist/_examples/pokemons/storages/pokemon.storage.d.ts +0 -3
- package/dist/_examples/pokemons/storages/pokemon.storage.d.ts.map +0 -1
- package/dist/_examples/pokemons/storages/pokemon.storage.js +0 -14
- package/dist/_examples/pokemons/storages/pokemon.storage.js.map +0 -1
- package/dist/_examples/pokemons/store.d.ts +0 -1
- package/dist/_examples/pokemons/store.d.ts.map +0 -1
- package/dist/_examples/pokemons/store.js +0 -2
- package/dist/_examples/pokemons/store.js.map +0 -1
- package/dist/_examples/pokemons/store1.d.ts +0 -23
- package/dist/_examples/pokemons/store1.d.ts.map +0 -1
- package/dist/_examples/pokemons/store1.js +0 -35
- package/dist/_examples/pokemons/store1.js.map +0 -1
- package/dist/_examples/pokemons/store2.d.ts +0 -23
- package/dist/_examples/pokemons/store2.d.ts.map +0 -1
- package/dist/_examples/pokemons/store2.js +0 -34
- package/dist/_examples/pokemons/store2.js.map +0 -1
- package/dist/_examples/pokemons/types.d.ts +0 -26
- package/dist/_examples/pokemons/types.d.ts.map +0 -1
- package/dist/_examples/pokemons/types.js +0 -2
- package/dist/_examples/pokemons/types.js.map +0 -1
- package/dist/core/storage/adapters/idb.d.ts +0 -52
- package/dist/core/storage/adapters/idb.d.ts.map +0 -1
- package/dist/core/storage/adapters/idb.js +0 -528
- package/dist/core/storage/adapters/idb.js.map +0 -1
- package/dist/core/storage/adapters/indexed-DB.service1.d.ts +0 -38
- package/dist/core/storage/adapters/indexed-DB.service1.d.ts.map +0 -1
- package/dist/core/storage/adapters/indexed-DB.service1.js +0 -318
- package/dist/core/storage/adapters/indexed-DB.service1.js.map +0 -1
- package/dist/core/storage/adapters/indexed-DB.service2.d.ts +0 -61
- package/dist/core/storage/adapters/indexed-DB.service2.d.ts.map +0 -1
- package/dist/core/storage/adapters/indexed-DB.service2.js +0 -596
- package/dist/core/storage/adapters/indexed-DB.service2.js.map +0 -1
- package/dist/core/storage/factory/createSynapseStorage.factory.d.ts +0 -1
- package/dist/core/storage/factory/createSynapseStorage.factory.d.ts.map +0 -1
- package/dist/core/storage/factory/createSynapseStorage.factory.js +0 -2
- package/dist/core/storage/factory/createSynapseStorage.factory.js.map +0 -1
- package/dist/core/storage/factory/index.d.ts +0 -2
- package/dist/core/storage/factory/index.d.ts.map +0 -1
- package/dist/core/storage/factory/index.js +0 -2
- package/dist/core/storage/factory/index.js.map +0 -1
- package/dist/examples/_example5.d.ts +0 -1
- package/dist/examples/_example5.d.ts.map +0 -1
- package/dist/examples/_example5.js +0 -184
- package/dist/examples/_example5.js.map +0 -1
- package/dist/examples/_example6.d.ts +0 -1
- package/dist/examples/_example6.d.ts.map +0 -1
- package/dist/examples/_example6.js +0 -168
- package/dist/examples/_example6.js.map +0 -1
- package/dist/examples/plugins.d.ts +0 -1
- package/dist/examples/plugins.d.ts.map +0 -1
- package/dist/examples/plugins.js +0 -176
- package/dist/examples/plugins.js.map +0 -1
- package/dist/examples/pokemons/PokemonList.d.ts +0 -2
- package/dist/examples/pokemons/PokemonList.d.ts.map +0 -1
- package/dist/examples/pokemons/PokemonList.js +0 -110
- package/dist/examples/pokemons/PokemonList.js.map +0 -1
- package/dist/examples/pokemons/api.d.ts +0 -22
- package/dist/examples/pokemons/api.d.ts.map +0 -1
- package/dist/examples/pokemons/api.js +0 -43
- package/dist/examples/pokemons/api.js.map +0 -1
- package/dist/examples/pokemons/app.config.d.ts +0 -15
- package/dist/examples/pokemons/app.config.d.ts.map +0 -1
- package/dist/examples/pokemons/app.config.js +0 -15
- package/dist/examples/pokemons/app.config.js.map +0 -1
- package/dist/examples/pokemons/dispatchers/pokemon.dispatcher.js +0 -128
- package/dist/examples/pokemons/dispatchers/pokemon.dispatcher.js.map +0 -1
- package/dist/examples/pokemons/effects/pokemon.effects.d.ts +0 -16
- package/dist/examples/pokemons/effects/pokemon.effects.d.ts.map +0 -1
- package/dist/examples/pokemons/effects/pokemon.effects.js +0 -51
- package/dist/examples/pokemons/effects/pokemon.effects.js.map +0 -1
- package/dist/examples/pokemons/middlewares/pokenon.middlewares.d.ts +0 -4
- package/dist/examples/pokemons/middlewares/pokenon.middlewares.d.ts.map +0 -1
- package/dist/examples/pokemons/middlewares/pokenon.middlewares.js +0 -28
- package/dist/examples/pokemons/middlewares/pokenon.middlewares.js.map +0 -1
- package/dist/examples/pokemons/selectors/pokemon.selectors.d.ts +0 -13
- package/dist/examples/pokemons/selectors/pokemon.selectors.d.ts.map +0 -1
- package/dist/examples/pokemons/selectors/pokemon.selectors.js +0 -7
- package/dist/examples/pokemons/selectors/pokemon.selectors.js.map +0 -1
- package/dist/examples/pokemons/storages/pokemon.storage.d.ts +0 -5
- package/dist/examples/pokemons/storages/pokemon.storage.d.ts.map +0 -1
- package/dist/examples/pokemons/storages/pokemon.storage.js +0 -13
- package/dist/examples/pokemons/storages/pokemon.storage.js.map +0 -1
- package/dist/examples/pokemons/store.d.ts +0 -35
- package/dist/examples/pokemons/store.d.ts.map +0 -1
- package/dist/examples/pokemons/store.js +0 -21
- package/dist/examples/pokemons/store.js.map +0 -1
- package/dist/examples/pokemons/types.d.ts +0 -26
- package/dist/examples/pokemons/types.d.ts.map +0 -1
- package/dist/examples/pokemons/types.js +0 -2
- package/dist/examples/pokemons/types.js.map +0 -1
- package/dist/react/utils/createSynapse.d.ts +0 -47
- package/dist/react/utils/createSynapse.d.ts.map +0 -1
- package/dist/react/utils/createSynapse.js +0 -83
- package/dist/react/utils/createSynapse.js.map +0 -1
- package/dist/react/utils/createSynapseContext.d.ts +0 -29
- package/dist/react/utils/createSynapseContext.d.ts.map +0 -1
- package/dist/react/utils/createSynapseContext.js +0 -112
- package/dist/react/utils/createSynapseContext.js.map +0 -1
- package/dist/utils/chunk.util.d.ts +0 -8
- package/dist/utils/chunk.util.d.ts.map +0 -1
- package/dist/utils/chunk.util.js +0 -21
- package/dist/utils/chunk.util.js.map +0 -1
- package/dist/utils/deepMerge.util.d.ts +0 -2
- package/dist/utils/deepMerge.util.d.ts.map +0 -1
- package/dist/utils/deepMerge.util.js +0 -16
- package/dist/utils/deepMerge.util.js.map +0 -1
- package/dist/utils/flatMap.util.d.ts +0 -10
- package/dist/utils/flatMap.util.d.ts.map +0 -1
- package/dist/utils/flatMap.util.js +0 -23
- package/dist/utils/flatMap.util.js.map +0 -1
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// import { IStoragePlugin, PluginContext, StorageKeyType } from 'synapse'
|
|
3
|
-
//
|
|
4
|
-
// /**
|
|
5
|
-
// * Пример 1: LoggingPlugin
|
|
6
|
-
// *
|
|
7
|
-
// * Плагин для логирования операций хранилища.
|
|
8
|
-
// * Записывает информацию о всех операциях в консоль или пользовательский логгер.
|
|
9
|
-
// */
|
|
10
|
-
// export class LoggingPlugin implements IStoragePlugin {
|
|
11
|
-
// name = 'logging'
|
|
12
|
-
//
|
|
13
|
-
// constructor(
|
|
14
|
-
// private options: {
|
|
15
|
-
// logLevel?: 'info' | 'debug' | 'verbose',
|
|
16
|
-
// customLogger?: (message: string, data?: any) => void
|
|
17
|
-
// } = {},
|
|
18
|
-
// ) {}
|
|
19
|
-
//
|
|
20
|
-
// private log(message: string, data?: any): void {
|
|
21
|
-
// const formattedMessage = `[LoggingPlugin] ${message}`
|
|
22
|
-
//
|
|
23
|
-
// if (this.options.customLogger) {
|
|
24
|
-
// this.options.customLogger(formattedMessage, data)
|
|
25
|
-
// } else if (this.options.logLevel === 'verbose') {
|
|
26
|
-
// console.log(formattedMessage, data)
|
|
27
|
-
// } else if (this.options.logLevel === 'debug' || !this.options.logLevel) {
|
|
28
|
-
// console.log(formattedMessage)
|
|
29
|
-
// } else {
|
|
30
|
-
// console.log(formattedMessage)
|
|
31
|
-
// }
|
|
32
|
-
// }
|
|
33
|
-
//
|
|
34
|
-
// async initialize(): Promise<void> {
|
|
35
|
-
// this.log('Плагин инициализирован')
|
|
36
|
-
// }
|
|
37
|
-
//
|
|
38
|
-
// async destroy(): Promise<void> {
|
|
39
|
-
// this.log('Плагин уничтожен')
|
|
40
|
-
// }
|
|
41
|
-
//
|
|
42
|
-
// async onBeforeSet<T>(value: T, context: PluginContext): Promise<T> {
|
|
43
|
-
// this.log(
|
|
44
|
-
// `Сохранение значения в хранилище ${context.storageName}`,
|
|
45
|
-
// this.options.logLevel === 'verbose' ? value : undefined,
|
|
46
|
-
// )
|
|
47
|
-
// return value
|
|
48
|
-
// }
|
|
49
|
-
//
|
|
50
|
-
// async onAfterSet<T>(key: StorageKeyType, value: T, context: PluginContext): Promise<T> {
|
|
51
|
-
// this.log(
|
|
52
|
-
// `Значение сохранено по ключу ${String(key)}`,
|
|
53
|
-
// this.options.logLevel === 'verbose' ? value : undefined,
|
|
54
|
-
// )
|
|
55
|
-
// return value
|
|
56
|
-
// }
|
|
57
|
-
//
|
|
58
|
-
// async onBeforeGet(key: StorageKeyType, context: PluginContext): Promise<StorageKeyType> {
|
|
59
|
-
// this.log(`Запрос значения по ключу ${String(key)}`)
|
|
60
|
-
// return key
|
|
61
|
-
// }
|
|
62
|
-
//
|
|
63
|
-
// async onAfterGet<T>(key: StorageKeyType, value: T | undefined, context: PluginContext): Promise<T | undefined> {
|
|
64
|
-
// if (value === undefined) {
|
|
65
|
-
// this.log(`Значение не найдено по ключу ${String(key)}`)
|
|
66
|
-
// } else {
|
|
67
|
-
// this.log(
|
|
68
|
-
// `Получено значение по ключу ${String(key)}`,
|
|
69
|
-
// this.options.logLevel === 'verbose' ? value : undefined,
|
|
70
|
-
// )
|
|
71
|
-
// }
|
|
72
|
-
// return value
|
|
73
|
-
// }
|
|
74
|
-
//
|
|
75
|
-
// async onBeforeDelete(key: StorageKeyType, context: PluginContext): Promise<boolean> {
|
|
76
|
-
// this.log(`Запрос на удаление значения по ключу ${String(key)}`)
|
|
77
|
-
// return true
|
|
78
|
-
// }
|
|
79
|
-
//
|
|
80
|
-
// async onAfterDelete(key: StorageKeyType, context: PluginContext): Promise<void> {
|
|
81
|
-
// this.log(`Значение удалено по ключу ${String(key)}`)
|
|
82
|
-
// }
|
|
83
|
-
//
|
|
84
|
-
// async onClear(context: PluginContext): Promise<void> {
|
|
85
|
-
// this.log(`Хранилище ${context.storageName} очищено`)
|
|
86
|
-
// }
|
|
87
|
-
// }
|
|
88
|
-
//
|
|
89
|
-
// /**
|
|
90
|
-
// * Пример 2: ValidationPlugin
|
|
91
|
-
// *
|
|
92
|
-
// * Плагин для валидации данных перед сохранением в хранилище.
|
|
93
|
-
// * Позволяет устанавливать правила валидации для определенных ключей.
|
|
94
|
-
// */
|
|
95
|
-
// export class ValidationPlugin implements IStoragePlugin {
|
|
96
|
-
// name = 'validation'
|
|
97
|
-
//
|
|
98
|
-
// private validators = new Map<string, (value: any) => { valid: boolean, message?: string }>()
|
|
99
|
-
//
|
|
100
|
-
// constructor(
|
|
101
|
-
// private options: {
|
|
102
|
-
// throwOnInvalid?: boolean;
|
|
103
|
-
// onValidationError?: (key: string, value: any, message: string) => void;
|
|
104
|
-
// } = { throwOnInvalid: true },
|
|
105
|
-
// ) {}
|
|
106
|
-
//
|
|
107
|
-
// /**
|
|
108
|
-
// * Добавляет правило валидации для определенного ключа
|
|
109
|
-
// *
|
|
110
|
-
// * @param key Ключ, для которого применяется валидация
|
|
111
|
-
// * @param validator Функция валидации, возвращающая результат проверки
|
|
112
|
-
// * @returns Экземпляр плагина для цепочки вызовов
|
|
113
|
-
// */
|
|
114
|
-
// addValidator(
|
|
115
|
-
// key: string,
|
|
116
|
-
// validator: (value: any) => { valid: boolean, message?: string },
|
|
117
|
-
// ): this {
|
|
118
|
-
// this.validators.set(key, validator)
|
|
119
|
-
// return this
|
|
120
|
-
// }
|
|
121
|
-
//
|
|
122
|
-
// /**
|
|
123
|
-
// * Помощник для создания валидатора по JSON-схеме
|
|
124
|
-
// *
|
|
125
|
-
// * @param schema Объект описывающий схему данных
|
|
126
|
-
// * @returns Функция-валидатор
|
|
127
|
-
// */
|
|
128
|
-
// static schemaValidator(schema: any): (value: any) => { valid: boolean, message?: string } {
|
|
129
|
-
// return (value: any) => {
|
|
130
|
-
// // Здесь должна быть реализация проверки по JSON-схеме
|
|
131
|
-
// // Для примера используем упрощенную логику
|
|
132
|
-
// if (schema.type === 'object' && typeof value !== 'object') {
|
|
133
|
-
// return { valid: false, message: 'Value must be an object' }
|
|
134
|
-
// }
|
|
135
|
-
//
|
|
136
|
-
// if (schema.type === 'array' && !Array.isArray(value)) {
|
|
137
|
-
// return { valid: false, message: 'Value must be an array' }
|
|
138
|
-
// }
|
|
139
|
-
//
|
|
140
|
-
// if (schema.required && Array.isArray(schema.required)) {
|
|
141
|
-
// for (const prop of schema.required) {
|
|
142
|
-
// if (value[prop] === undefined) {
|
|
143
|
-
// return { valid: false, message: `Required property "${prop}" is missing` }
|
|
144
|
-
// }
|
|
145
|
-
// }
|
|
146
|
-
// }
|
|
147
|
-
//
|
|
148
|
-
// return { valid: true }
|
|
149
|
-
// }
|
|
150
|
-
// }
|
|
151
|
-
//
|
|
152
|
-
// async onBeforeSet<T>(value: T, context: PluginContext): Promise<T> {
|
|
153
|
-
// // Получаем ключ из метаданных (должен быть добавлен хранилищем)
|
|
154
|
-
// const key = context.metadata?.key
|
|
155
|
-
//
|
|
156
|
-
// if (key && this.validators.has(key)) {
|
|
157
|
-
// const validator = this.validators.get(key)!
|
|
158
|
-
// const result = validator(value)
|
|
159
|
-
//
|
|
160
|
-
// if (!result.valid) {
|
|
161
|
-
// const errorMessage = result.message || `Validation failed for key "${key}"`
|
|
162
|
-
//
|
|
163
|
-
// if (this.options.onValidationError) {
|
|
164
|
-
// this.options.onValidationError(key, value, errorMessage)
|
|
165
|
-
// }
|
|
166
|
-
//
|
|
167
|
-
// if (this.options.throwOnInvalid) {
|
|
168
|
-
// throw new Error(errorMessage)
|
|
169
|
-
// }
|
|
170
|
-
// }
|
|
171
|
-
// }
|
|
172
|
-
//
|
|
173
|
-
// return value
|
|
174
|
-
// }
|
|
175
|
-
// }
|
|
176
|
-
//# sourceMappingURL=plugins.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../src/_examples/plugins.ts"],"names":[],"mappings":";AAAA,0EAA0E;AAC1E,EAAE;AACF,MAAM;AACN,6BAA6B;AAC7B,KAAK;AACL,gDAAgD;AAChD,mFAAmF;AACnF,MAAM;AACN,yDAAyD;AACzD,qBAAqB;AACrB,EAAE;AACF,iBAAiB;AACjB,yBAAyB;AACzB,iDAAiD;AACjD,6DAA6D;AAC7D,cAAc;AACd,SAAS;AACT,EAAE;AACF,qDAAqD;AACrD,4DAA4D;AAC5D,EAAE;AACF,uCAAuC;AACvC,0DAA0D;AAC1D,wDAAwD;AACxD,4CAA4C;AAC5C,gFAAgF;AAChF,sCAAsC;AACtC,eAAe;AACf,sCAAsC;AACtC,QAAQ;AACR,MAAM;AACN,EAAE;AACF,wCAAwC;AACxC,yCAAyC;AACzC,MAAM;AACN,EAAE;AACF,qCAAqC;AACrC,mCAAmC;AACnC,MAAM;AACN,EAAE;AACF,yEAAyE;AACzE,gBAAgB;AAChB,kEAAkE;AAClE,iEAAiE;AACjE,QAAQ;AACR,mBAAmB;AACnB,MA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;AAChD,6CAA6C;AAC7C,yFAAyF;AACzF,cAAc;AACd,YAAY;AACZ,UAAU;AACV,EAAE;AACF,+BAA+B;AAC/B,QAAQ;AACR,MAAM;AACN,EAAE;AACF,yEAAyE;AACzE,uEAAuE;AACvE,wCAAwC;AACxC,EAAE;AACF,6CAA6C;AAC7C,oDAAoD;AACpD,wCAAwC;AACxC,EAAE;AACF,6BAA6B;AAC7B,sFAAsF;AACtF,EAAE;AACF,gDAAgD;AAChD,qEAAqE;AACrE,YAAY;AACZ,EAAE;AACF,6CAA6C;AAC7C,0CAA0C;AAC1C,YAAY;AACZ,UAAU;AACV,QAAQ;AACR,EAAE;AACF,mBAAmB;AACnB,MAAM;AACN,IAAI"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PokemonList.d.ts","sourceRoot":"","sources":["../../../src/_examples/pokemons/PokemonList.tsx"],"names":[],"mappings":"AAMA;;GAEG;AACH,wBAAgB,mBAAmB,4CAsQlC"}
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState } from 'react';
|
|
3
|
-
import { distinctUntilChanged, map } from 'rxjs/operators';
|
|
4
|
-
import { useSelector, useStorageSubscribe } from 'synapse/react';
|
|
5
|
-
import { pokemonActions, pokemonSelectors, pokemonState$, pokemonStorage } from './store1';
|
|
6
|
-
/**
|
|
7
|
-
* Упрощенный React-компонент для работы с одним покемоном
|
|
8
|
-
*/
|
|
9
|
-
export function SimplePokemonViewer() {
|
|
10
|
-
const [state, setState] = useState({
|
|
11
|
-
currentPokemon: null,
|
|
12
|
-
loading: true,
|
|
13
|
-
error: null,
|
|
14
|
-
currentId: 1,
|
|
15
|
-
});
|
|
16
|
-
const d = useSelector(pokemonSelectors.val1);
|
|
17
|
-
const d1 = useStorageSubscribe(pokemonStorage, (s) => 1);
|
|
18
|
-
// console.log('pokemonSelectors useSelector', d)
|
|
19
|
-
console.log('d1', d1);
|
|
20
|
-
useEffect(() => {
|
|
21
|
-
pokemonSelectors.val1.select().then((val) => {
|
|
22
|
-
// console.log('pokemonSelectors select', val)
|
|
23
|
-
});
|
|
24
|
-
const ddwe = pokemonStorage.subscribe((s) => s.currentPokemon, () => {
|
|
25
|
-
});
|
|
26
|
-
}, []);
|
|
27
|
-
useEffect(() => {
|
|
28
|
-
pokemonSelectors.val1.subscribe({
|
|
29
|
-
notify: (s) => {
|
|
30
|
-
// console.log('pokemonSelectors subscribe', s)
|
|
31
|
-
},
|
|
32
|
-
});
|
|
33
|
-
}, []);
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
const subscription = pokemonState$.pipe(map((state) => state.currentId), distinctUntilChanged()).subscribe((state) => {
|
|
36
|
-
// console.log('Текущее состояние REACTIVE:', state)
|
|
37
|
-
});
|
|
38
|
-
return () => {
|
|
39
|
-
subscription.unsubscribe();
|
|
40
|
-
};
|
|
41
|
-
}, []);
|
|
42
|
-
useEffect(() => {
|
|
43
|
-
// Подписываемся на изменения состояния напрямую из хранилища
|
|
44
|
-
const unsubscribe = pokemonStorage.subscribeToAll((event) => {
|
|
45
|
-
// Обновляем состояние при изменении
|
|
46
|
-
pokemonStorage.getState().then((state) => {
|
|
47
|
-
// console.log('Текущее состояние ОБЫЧНОЕ:', state)
|
|
48
|
-
if (state)
|
|
49
|
-
setState(state);
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
// Инициируем загрузку первого покемона через действия
|
|
53
|
-
pokemonActions.loadPokemon(1);
|
|
54
|
-
// Отписываемся при размонтировании
|
|
55
|
-
return () => unsubscribe();
|
|
56
|
-
}, []);
|
|
57
|
-
// Обработчики действий
|
|
58
|
-
const handleNext = () => {
|
|
59
|
-
pokemonActions.next().then((result) => {
|
|
60
|
-
// console.log('Результат:', result) // Покажет { id: число }
|
|
61
|
-
});
|
|
62
|
-
};
|
|
63
|
-
const handlePrev = () => {
|
|
64
|
-
pokemonActions.prev();
|
|
65
|
-
};
|
|
66
|
-
const handleLoadById = (id) => {
|
|
67
|
-
if (id >= 1 && id <= 151) {
|
|
68
|
-
pokemonActions.loadPokemon(id).then((result) => {
|
|
69
|
-
// console.log('Результат:', result) // Покажет { id: число }
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
// Стили
|
|
74
|
-
const styles = {
|
|
75
|
-
container: {
|
|
76
|
-
maxWidth: '600px',
|
|
77
|
-
margin: '0 auto',
|
|
78
|
-
padding: '20px',
|
|
79
|
-
fontFamily: 'Arial, sans-serif',
|
|
80
|
-
textAlign: 'center',
|
|
81
|
-
},
|
|
82
|
-
title: {
|
|
83
|
-
fontSize: '24px',
|
|
84
|
-
fontWeight: 'bold',
|
|
85
|
-
marginBottom: '20px',
|
|
86
|
-
},
|
|
87
|
-
card: {
|
|
88
|
-
border: '1px solid #ddd',
|
|
89
|
-
borderRadius: '8px',
|
|
90
|
-
padding: '20px',
|
|
91
|
-
margin: '20px 0',
|
|
92
|
-
background: 'white',
|
|
93
|
-
boxShadow: '0 2px 4px rgba(0,0,0,0.1)',
|
|
94
|
-
},
|
|
95
|
-
pokemonName: {
|
|
96
|
-
fontSize: '20px',
|
|
97
|
-
fontWeight: 'bold',
|
|
98
|
-
textTransform: 'capitalize',
|
|
99
|
-
marginTop: '10px',
|
|
100
|
-
},
|
|
101
|
-
pokemonImage: {
|
|
102
|
-
width: '180px',
|
|
103
|
-
height: '180px',
|
|
104
|
-
},
|
|
105
|
-
typeBadge: {
|
|
106
|
-
display: 'inline-block',
|
|
107
|
-
padding: '4px 8px',
|
|
108
|
-
margin: '4px',
|
|
109
|
-
borderRadius: '16px',
|
|
110
|
-
fontSize: '12px',
|
|
111
|
-
background: '#eee',
|
|
112
|
-
},
|
|
113
|
-
stats: {
|
|
114
|
-
margin: '15px 0',
|
|
115
|
-
textAlign: 'left',
|
|
116
|
-
},
|
|
117
|
-
controls: {
|
|
118
|
-
display: 'flex',
|
|
119
|
-
justifyContent: 'space-between',
|
|
120
|
-
alignItems: 'center',
|
|
121
|
-
margin: '20px 0',
|
|
122
|
-
},
|
|
123
|
-
button: {
|
|
124
|
-
padding: '10px 20px',
|
|
125
|
-
background: '#0077cc',
|
|
126
|
-
color: 'white',
|
|
127
|
-
border: 'none',
|
|
128
|
-
borderRadius: '4px',
|
|
129
|
-
cursor: 'pointer',
|
|
130
|
-
fontSize: '16px',
|
|
131
|
-
},
|
|
132
|
-
input: {
|
|
133
|
-
padding: '10px',
|
|
134
|
-
fontSize: '16px',
|
|
135
|
-
borderRadius: '4px',
|
|
136
|
-
border: '1px solid #ddd',
|
|
137
|
-
width: '60px',
|
|
138
|
-
textAlign: 'center',
|
|
139
|
-
},
|
|
140
|
-
loader: {
|
|
141
|
-
padding: '40px',
|
|
142
|
-
fontSize: '18px',
|
|
143
|
-
},
|
|
144
|
-
error: {
|
|
145
|
-
padding: '16px',
|
|
146
|
-
background: '#ffebee',
|
|
147
|
-
color: '#c62828',
|
|
148
|
-
borderRadius: '4px',
|
|
149
|
-
margin: '20px 0',
|
|
150
|
-
},
|
|
151
|
-
};
|
|
152
|
-
// Форма ввода ID
|
|
153
|
-
function IdInput() {
|
|
154
|
-
const [inputId, setInputId] = useState('');
|
|
155
|
-
const handleSubmit = (e) => {
|
|
156
|
-
e.preventDefault();
|
|
157
|
-
const id = parseInt(inputId, 10);
|
|
158
|
-
if (!isNaN(id)) {
|
|
159
|
-
handleLoadById(id);
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
return (_jsxs("form", { onSubmit: handleSubmit, style: { marginTop: '20px' }, children: [_jsxs("label", { children: ["Go to Pok\u00E9mon #:", _jsx("input", { type: "number", min: "1", max: "151", value: inputId, onChange: (e) => setInputId(e.target.value), style: styles.input })] }), _jsx("button", { type: "submit", style: { ...styles.button, marginLeft: '10px' }, children: "Go" })] }));
|
|
163
|
-
}
|
|
164
|
-
return (_jsxs("div", { style: styles.container, children: [_jsx("h1", { style: styles.title, children: "Pok\u00E9mon Viewer" }), _jsxs("div", { style: styles.controls, children: [_jsx("button", { style: styles.button, onClick: handlePrev, children: "Previous" }), _jsxs("div", { children: ["Pok\u00E9mon #", state.currentId] }), _jsx("button", { style: styles.button, onClick: handleNext, children: "Next" })] }), state.error && (_jsx("div", { style: styles.error, children: _jsxs("p", { children: ["Error:", state.error] }) })), state.loading ? (_jsx("div", { style: styles.loader, children: _jsx("p", { children: "Loading Pok\u00E9mon..." }) })) : state.currentPokemon ? (_jsxs("div", { style: styles.card, children: [_jsx("img", { src: state.currentPokemon.sprites.other?.['official-artwork']?.front_default || state.currentPokemon.sprites.front_default, alt: state.currentPokemon.name, style: styles.pokemonImage }), _jsx("h2", { style: styles.pokemonName, children: state.currentPokemon.name }), _jsx("div", { children: state.currentPokemon.types.map(({ type }) => (_jsx("span", { style: styles.typeBadge, children: type.name }, type.name))) }), _jsxs("div", { style: styles.stats, children: [_jsxs("p", { children: [_jsx("strong", { children: "Height:" }), ' ', state.currentPokemon.height / 10, ' ', "m"] }), _jsxs("p", { children: [_jsx("strong", { children: "Weight:" }), ' ', state.currentPokemon.weight / 10, ' ', "kg"] })] })] })) : null, _jsx(IdInput, {})] }));
|
|
165
|
-
}
|
|
166
|
-
//# sourceMappingURL=PokemonList.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PokemonList.js","sourceRoot":"","sources":["../../../src/_examples/pokemons/PokemonList.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAU,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC1D,OAAO,EAAE,oBAAoB,EAAU,GAAG,EAAE,MAAM,gBAAgB,CAAA;AAClE,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AAChE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAG1F;;GAEG;AACH,MAAM,UAAU,mBAAmB;IACjC,MAAM,CAAC,KAAK,EAAE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,cAAc,CAAC,MAAM,GAAG,EAAE,EAChC,GAAG,UAEF,IACA,IACF,CACP,CAAC,CAAC,CAAC,IAAI,EAER,KAAC,OAAO,KAAG,IACP,CACP,CAAA;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/_examples/pokemons/api.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,eAAO,MAAM,GAAG,KAoCd,CAAA;AAEF,eAAO,MAAM,UAAU,KAAmB,CAAA;AAK1C,eAAO,MAAM,gBAAgB,KAA4B,CAAA"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { ApiClient, ResponseFormat } from 'synapse/api';
|
|
2
|
-
export const api = new ApiClient({
|
|
3
|
-
storageType: 'indexedDB',
|
|
4
|
-
storageOptions: {
|
|
5
|
-
name: 'pokemon-api-storage',
|
|
6
|
-
dbName: 'pokemon-api-cache',
|
|
7
|
-
storeName: 'requests',
|
|
8
|
-
dbVersion: 1,
|
|
9
|
-
},
|
|
10
|
-
// Или boolean или объект с настройками
|
|
11
|
-
cache: {
|
|
12
|
-
// Время жизни кэша в миллисекундах
|
|
13
|
-
ttl: 5 * 60 * 1000, // 5 минут
|
|
14
|
-
// Инвалидировать кэш при ошибке
|
|
15
|
-
invalidateOnError: true,
|
|
16
|
-
cleanup: {
|
|
17
|
-
// Включить периодическую очистку
|
|
18
|
-
enabled: true,
|
|
19
|
-
// Интервал очистки в миллисекундах
|
|
20
|
-
interval: 10 * 60 * 1000, // 10 минут
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
baseQuery: {
|
|
24
|
-
baseUrl: 'https://pokeapi.co/api/v2',
|
|
25
|
-
timeout: 10000,
|
|
26
|
-
credentials: 'same-origin',
|
|
27
|
-
},
|
|
28
|
-
endpoints: async (create) => ({
|
|
29
|
-
fetchPokemonById: create({
|
|
30
|
-
request: (params) => ({
|
|
31
|
-
path: `/pokemon/${params.id}`,
|
|
32
|
-
method: 'GET',
|
|
33
|
-
responseFormat: ResponseFormat.Json,
|
|
34
|
-
}),
|
|
35
|
-
tags: ['pokemon-details'],
|
|
36
|
-
}),
|
|
37
|
-
}),
|
|
38
|
-
});
|
|
39
|
-
// Инициализация
|
|
40
|
-
export const pokemonApi = await api.init();
|
|
41
|
-
// Демонтирование
|
|
42
|
-
// await pokemonApi.destroy()
|
|
43
|
-
// Получение эндпоинтов
|
|
44
|
-
export const pokemonEndpoints = pokemonApi.getEndpoints();
|
|
45
|
-
//# sourceMappingURL=api.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/_examples/pokemons/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAQvD,MAAM,CAAC,MAAM,GAAG,GAAG,IAAI,SAAS,CAAC;IAC/B,WAAW,EAAE,WAAW;IACxB,cAAc,EAAE;QACd,IAAI,EAAE,qBAAqB;QAC3B,MAAM,EAAE,mBAAmB;QAC3B,SAAS,EAAE,UAAU;QACrB,SAAS,EAAE,CAAC;KACb;IACD,uCAAuC;IACvC,KAAK,EAAE;QACL,mCAAmC;QACnC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE,UAAU;QAC9B,iCAAiC;QACjC,iBAAiB,EAAE,IAAI;QACvB,OAAO,EAAE;YACP,iCAAiC;YACjC,OAAO,EAAE,IAAI;YACb,mCAAmC;YACnC,QAAQ,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,WAAW;SACtC;KACF;IACD,SAAS,EAAE;QACT,OAAO,EAAE,2BAA2B;QACpC,OAAO,EAAE,KAAK;QACd,WAAW,EAAE,aAAa;KAC3B;IACD,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;QAC5B,gBAAgB,EAAE,MAAM,CAA0B;YAChD,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;gBACpB,IAAI,EAAE,YAAY,MAAM,CAAC,EAAE,EAAE;gBAC7B,MAAM,EAAE,KAAK;gBACb,cAAc,EAAE,cAAc,CAAC,IAAI;aACpC,CAAC;YACF,IAAI,EAAE,CAAC,iBAAiB,CAAC;SAC1B,CAAC;KACH,CAAC;CACH,CAAC,CAAA;AACF,gBAAgB;AAChB,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAA;AAC1C,iBAAiB;AACjB,6BAA6B;AAE7B,uBAAuB;AACvB,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAC,YAAY,EAAE,CAAA"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export interface AppConfig {
|
|
2
|
-
apiBaseUrl: string;
|
|
3
|
-
apiKey: string;
|
|
4
|
-
requestTimeoutMs: number;
|
|
5
|
-
features: {
|
|
6
|
-
enableNotifications: boolean;
|
|
7
|
-
enableCache: boolean;
|
|
8
|
-
};
|
|
9
|
-
themeSettings: {
|
|
10
|
-
primaryColor: string;
|
|
11
|
-
secondaryColor: string;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
export declare const appConfig: AppConfig;
|
|
15
|
-
//# sourceMappingURL=app.config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app.config.d.ts","sourceRoot":"","sources":["../../../src/_examples/pokemons/app.config.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,gBAAgB,EAAE,MAAM,CAAA;IACxB,QAAQ,EAAE;QACR,mBAAmB,EAAE,OAAO,CAAA;QAC5B,WAAW,EAAE,OAAO,CAAA;KACrB,CAAA;IACD,aAAa,EAAE;QACb,YAAY,EAAE,MAAM,CAAA;QACpB,cAAc,EAAE,MAAM,CAAA;KACvB,CAAA;CACF;AAED,eAAO,MAAM,SAAS,EAAE,SAYvB,CAAA"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// Просто условный объект с конфигурацией, которую можно использовать в эффектах
|
|
2
|
-
export const appConfig = {
|
|
3
|
-
apiBaseUrl: 'https://pokeapi.co/api/v2',
|
|
4
|
-
apiKey: 'your-api-key-here',
|
|
5
|
-
requestTimeoutMs: 5000,
|
|
6
|
-
features: {
|
|
7
|
-
enableNotifications: true,
|
|
8
|
-
enableCache: true,
|
|
9
|
-
},
|
|
10
|
-
themeSettings: {
|
|
11
|
-
primaryColor: '#FF0000', // Pokemon Red!
|
|
12
|
-
secondaryColor: '#FFFFFF',
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=app.config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app.config.js","sourceRoot":"","sources":["../../../src/_examples/pokemons/app.config.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAiBhF,MAAM,CAAC,MAAM,SAAS,GAAc;IAClC,UAAU,EAAE,2BAA2B;IACvC,MAAM,EAAE,mBAAmB;IAC3B,gBAAgB,EAAE,IAAI;IACtB,QAAQ,EAAE;QACR,mBAAmB,EAAE,IAAI;QACzB,WAAW,EAAE,IAAI;KAClB;IACD,aAAa,EAAE;QACb,YAAY,EAAE,SAAS,EAAE,eAAe;QACxC,cAAc,EAAE,SAAS;KAC1B;CACF,CAAA"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { PokemonStorage } from '../storages/pokemon.storage';
|
|
2
|
-
export interface AlertPayload {
|
|
3
|
-
message: string;
|
|
4
|
-
type: 'info' | 'warning' | 'error' | 'success';
|
|
5
|
-
duration?: number;
|
|
6
|
-
}
|
|
7
|
-
export declare function createPokemonDispatcher(storage: PokemonStorage): any;
|
|
8
|
-
export type PokemonDispatcher = ReturnType<typeof createPokemonDispatcher>;
|
|
9
|
-
//# sourceMappingURL=pokemon.dispatcher.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pokemon.dispatcher.d.ts","sourceRoot":"","sources":["../../../../src/_examples/pokemons/dispatchers/pokemon.dispatcher.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAK5D,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAA;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAGD,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,cAAc,OAmI9D;AAGD,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { createDispatcher, loggerDispatcherMiddleware } from 'synapse/reactive';
|
|
2
|
-
import { createPokemonAlertMiddleware } from '../middlewares/pokenon.middlewares';
|
|
3
|
-
// Функция для создания диспетчера
|
|
4
|
-
export function createPokemonDispatcher(storage) {
|
|
5
|
-
// Создаем логгер middleware
|
|
6
|
-
const loggerMiddleware = loggerDispatcherMiddleware({
|
|
7
|
-
collapsed: true, // Сворачиваем группы в консоли для компактности
|
|
8
|
-
colors: {
|
|
9
|
-
title: '#3498db', // Кастомный синий цвет для заголовка
|
|
10
|
-
},
|
|
11
|
-
duration: true,
|
|
12
|
-
diff: true,
|
|
13
|
-
showFullState: true,
|
|
14
|
-
});
|
|
15
|
-
const alertM = createPokemonAlertMiddleware();
|
|
16
|
-
return createDispatcher({
|
|
17
|
-
storage,
|
|
18
|
-
middlewares: [loggerMiddleware, alertM],
|
|
19
|
-
}, (storage, { createWatcher, createAction }) => ({
|
|
20
|
-
// Добавляем watcher для отслеживания текущего ID
|
|
21
|
-
watchCurrentId: createWatcher({
|
|
22
|
-
type: 'pokemon/currentIdChanged',
|
|
23
|
-
selector: (state) => state.currentId,
|
|
24
|
-
shouldTrigger: (prev, curr) => prev !== curr,
|
|
25
|
-
meta: {
|
|
26
|
-
description: 'Следит за изменениями ID текущего покемона',
|
|
27
|
-
},
|
|
28
|
-
}),
|
|
29
|
-
// Watcher для отслеживания состояния загрузки
|
|
30
|
-
watchLoadingState: createWatcher({
|
|
31
|
-
type: 'pokemon/loadingStateChanged',
|
|
32
|
-
selector: (state) => state.loading,
|
|
33
|
-
}),
|
|
34
|
-
// Загрузка покемона по ID
|
|
35
|
-
loadPokemon: createAction({
|
|
36
|
-
type: 'pokemon/loadPokemonIdl',
|
|
37
|
-
action: async (id) => ({ id }),
|
|
38
|
-
}),
|
|
39
|
-
loadPokemonRequest: createAction({
|
|
40
|
-
type: 'pokemon/loadPokemonRequest',
|
|
41
|
-
action: async (id) => {
|
|
42
|
-
await storage.update((state) => {
|
|
43
|
-
state.loading = true;
|
|
44
|
-
state.error = null;
|
|
45
|
-
state.currentId = id;
|
|
46
|
-
});
|
|
47
|
-
return { id };
|
|
48
|
-
},
|
|
49
|
-
}),
|
|
50
|
-
// Успешное получение данных
|
|
51
|
-
success: createAction({
|
|
52
|
-
type: 'pokemon/success',
|
|
53
|
-
action: async ({ data }) => {
|
|
54
|
-
await storage.update((state) => {
|
|
55
|
-
state.currentPokemon = data;
|
|
56
|
-
state.loading = false;
|
|
57
|
-
state.error = null;
|
|
58
|
-
});
|
|
59
|
-
// Возвращаем данные покемона как payload
|
|
60
|
-
return { data };
|
|
61
|
-
},
|
|
62
|
-
}),
|
|
63
|
-
// Ошибка при получении данных
|
|
64
|
-
failure: createAction({
|
|
65
|
-
type: 'pokemon/failure',
|
|
66
|
-
action: async (err) => {
|
|
67
|
-
const errorMessage = err instanceof Error ? err.message : 'Unknown error';
|
|
68
|
-
await storage.update((state) => {
|
|
69
|
-
state.loading = false;
|
|
70
|
-
state.error = errorMessage;
|
|
71
|
-
});
|
|
72
|
-
// Возвращаем ошибку как payload
|
|
73
|
-
return { err };
|
|
74
|
-
},
|
|
75
|
-
}),
|
|
76
|
-
// Перейти к следующему покемону
|
|
77
|
-
next: createAction({
|
|
78
|
-
type: 'pokemon/next',
|
|
79
|
-
action: async () => {
|
|
80
|
-
let newId = 1;
|
|
81
|
-
await storage.update((state) => {
|
|
82
|
-
newId = state.currentId + 1;
|
|
83
|
-
if (newId > 151)
|
|
84
|
-
newId = 1; // Ограничиваем первым поколением (1-151)
|
|
85
|
-
state.currentId = newId;
|
|
86
|
-
});
|
|
87
|
-
return { id: newId };
|
|
88
|
-
},
|
|
89
|
-
}),
|
|
90
|
-
// Перейти к предыдущему покемону
|
|
91
|
-
prev: createAction({
|
|
92
|
-
type: 'pokemon/prev',
|
|
93
|
-
action: async () => {
|
|
94
|
-
let newId = 1;
|
|
95
|
-
await storage.update((state) => {
|
|
96
|
-
newId = state.currentId - 1;
|
|
97
|
-
if (newId < 1)
|
|
98
|
-
newId = 151; // Ограничиваем первым поколением (1-151)
|
|
99
|
-
state.currentId = newId;
|
|
100
|
-
});
|
|
101
|
-
console.log(`Action: Previous pokemon (ID ${newId})`);
|
|
102
|
-
// Возвращаем новый id как payload
|
|
103
|
-
return { id: newId };
|
|
104
|
-
},
|
|
105
|
-
}),
|
|
106
|
-
showAlert: createAction({
|
|
107
|
-
type: 'pokemon/showAlert',
|
|
108
|
-
action: async (payload) => {
|
|
109
|
-
// Используем глобальный alert для демонстрации
|
|
110
|
-
alert(payload.message);
|
|
111
|
-
// Здесь можно также обновить состояние для отображения alert в UI
|
|
112
|
-
// например, добавить запись в массив alerts в state
|
|
113
|
-
},
|
|
114
|
-
meta: {
|
|
115
|
-
description: 'Показывает оповещение пользователю',
|
|
116
|
-
},
|
|
117
|
-
}),
|
|
118
|
-
}));
|
|
119
|
-
// .use(logger)
|
|
120
|
-
// .use(alertM)
|
|
121
|
-
}
|
|
122
|
-
//# sourceMappingURL=pokemon.dispatcher.js.map
|
|
@@ -1 +0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ACF,CAAC;QAEF,SAAS,EAAE,YAAY,CAAqB;YAC1C,IAAI,EAAE,mBAAmB;YACzB,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;gBACxB,+CAA+C;gBAC/C,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;gBAEtB,kEAAkE;gBAClE,oDAAoD;YACtD,CAAC;YACD,IAAI,EAAE;gBACJ,WAAW,EAAE,oCAAoC;aAClD;SACF,CAAC;KACH,CAAC,CAAC,CAAA;IACH,eAAe;IACf,eAAe;AACjB,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { pokemonEndpoints } from '../api.md';
|
|
2
|
-
import { AppConfig } from '../app.config';
|
|
3
|
-
import { PokemonDispatcher } from '../pokemon.dispatcher';
|
|
4
|
-
import { PokemonState } from '../types';
|
|
5
|
-
type PokemonDispatcherType = {
|
|
6
|
-
pokemonDispatcher: PokemonDispatcher;
|
|
7
|
-
};
|
|
8
|
-
type PokemonApiType = {
|
|
9
|
-
pokemonApi: typeof pokemonEndpoints;
|
|
10
|
-
};
|
|
11
|
-
export declare const navigationEffect: import("../../../../dist/reactive").Effect<PokemonState, PokemonDispatcherType, PokemonApiType, AppConfig>;
|
|
12
|
-
export declare const watchIdEffect: import("../../../../dist/reactive").Effect<PokemonState, PokemonDispatcherType, PokemonApiType, AppConfig>;
|
|
13
|
-
export declare const loadPokemonEffect: import("../../../../dist/reactive").Effect<PokemonState, PokemonDispatcherType, PokemonApiType, AppConfig>;
|
|
14
|
-
export declare const pokemonEffects: import("../../../../dist/reactive").Effect<PokemonState, PokemonDispatcherType, PokemonApiType, AppConfig>;
|
|
15
|
-
export {};
|
|
16
|
-
//# sourceMappingURL=pokemon.effects.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pokemon.effects.d.ts","sourceRoot":"","sources":["../../../../src/_examples/pokemons/effects/pokemon.effects.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,EAAW,YAAY,EAAE,MAAM,UAAU,CAAA;AAGhD,KAAK,qBAAqB,GAAG;IAAE,iBAAiB,EAAE,iBAAiB,CAAA;CAAE,CAAA;AACrE,KAAK,cAAc,GAAG;IAAE,UAAU,EAAE,OAAO,gBAAgB,CAAA;CAAE,CAAA;AAG7D,eAAO,MAAM,gBAAgB,4GAQ5B,CAAA;AAGD,eAAO,MAAM,aAAa,4GAezB,CAAA;AAGD,eAAO,MAAM,iBAAiB,4GAgC7B,CAAA;AAGD,eAAO,MAAM,cAAc,4GAAqE,CAAA"}
|