Skip to content

Commit bc949a3

Browse files
committed
🐛 update references from jsonSerializableContainer to jsonContainer
1 parent a90af1b commit bc949a3

File tree

8 files changed

+17
-17
lines changed

8 files changed

+17
-17
lines changed

packages/hyper_storage/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ class User {
233233
Map<String, dynamic> toJson() => {'id': id, 'name': name};
234234
}
235235
236-
final users = await storage.jsonSerializableContainer<User>(
236+
final users = await storage.jsonContainer<User>(
237237
'users',
238238
fromJson: User.fromJson,
239239
toJson: (user) => user.toJson(),

packages/hyper_storage/docs/containers.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Containers also support storing and retrieving JSON serializable objects. You ca
6262
store complex data structures in a structured way. For example, storing a list of Todo items with `Todo` class.
6363

6464
```dart
65-
final todos = await storage.jsonSerializableContainer<Todo>(
65+
final todos = await storage.jsonContainer<Todo>(
6666
'todos',
6767
fromJson: Todo.fromJson,
6868
toJson: (todo) => todo.toJson(),
@@ -79,7 +79,7 @@ By default, serializable containers would generate a unique String ID for each o
7979
also provide a custom ID by providing a `idGetter` function when creating the container.
8080

8181
```dart
82-
final todos = await storage.jsonSerializableContainer<Todo>(
82+
final todos = await storage.jsonContainer<Todo>(
8383
'todos',
8484
fromJson: Todo.fromJson,
8585
toJson: (todo) => todo.toJson(),
@@ -144,7 +144,7 @@ This is done to isolate the keys into a namespace, preventing key collisions bet
144144
change the delimiter for serializable containers by providing the `delimiter` argument when creating them.
145145

146146
```dart
147-
final todos = await storage.jsonSerializableContainer<Todo>(
147+
final todos = await storage.jsonContainer<Todo>(
148148
'todos',
149149
fromJson: Todo.fromJson,
150150
toJson: (todo) => todo.toJson(),

packages/hyper_storage/docs/getting_started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ class User {
189189
Map<String, dynamic> toJson() => {'id': id, 'name': name};
190190
}
191191
192-
final users = await storage.jsonSerializableContainer<User>(
192+
final users = await storage.jsonContainer<User>(
193193
'users',
194194
fromJson: User.fromJson,
195195
toJson: (user) => user.toJson(),

packages/hyper_storage/docs/reactivity.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ object.
265265

266266
```dart
267267
268-
final todos = await storage.jsonSerializableContainer<Todo>('todos',
268+
final todos = await storage.jsonContainer<Todo>('todos',
269269
fromJson: Todo.fromJson,
270270
toJson: (todo) => todo.toJson(),
271271
);
@@ -287,7 +287,7 @@ You can also stream changes for a specific key in a `SerializableStorageContaine
287287

288288
```dart
289289
290-
final todos = await storage.jsonSerializableContainer<Todo>('todos',
290+
final todos = await storage.jsonContainer<Todo>('todos',
291291
fromJson: Todo.fromJson,
292292
toJson: (todo) => todo.toJson(),
293293
);

packages/hyper_storage/example/example.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class User {
135135
Map<String, dynamic> toJson() => {'id': id, 'name': name};
136136
}
137137
138-
final users = await storage.jsonSerializableContainer<User>(
138+
final users = await storage.jsonContainer<User>(
139139
'users',
140140
fromJson: User.fromJson,
141141
toJson: (user) => user.toJson(),

packages/hyper_storage/lib/src/hyper_storage.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class HyperStorage extends _HyperStorageImpl {
5959
/// Cache of serializable object containers indexed by name.
6060
///
6161
/// This map stores [SerializableStorageContainer] instances created through
62-
/// [jsonSerializableContainer] or [objectContainer] methods. Containers are
62+
/// [jsonContainer] or [objectContainer] methods. Containers are
6363
/// cached to ensure the same instance is returned for repeated requests with
6464
/// the same name, maintaining consistency of listeners and state.
6565
final Map<String, SerializableStorageContainer> _objectContainers = {};
@@ -195,7 +195,7 @@ class HyperStorage extends _HyperStorageImpl {
195195
/// Otherwise, a new container is created and cached.
196196
///
197197
/// See also:
198-
/// - [jsonSerializableContainer] for storing custom objects with JSON
198+
/// - [jsonContainer] for storing custom objects with JSON
199199
/// - [objectContainer] for custom serialization logic
200200
/// - [StorageContainer] for available operations
201201
Future<HyperStorageContainer> container(String name) async {
@@ -245,7 +245,7 @@ class HyperStorage extends _HyperStorageImpl {
245245
/// - [container] for basic storage containers
246246
/// - [objectContainer] for custom serialization logic
247247
/// - [JsonStorageContainer] for available operations
248-
Future<JsonStorageContainer<E>> jsonSerializableContainer<E extends Object>(
248+
Future<JsonStorageContainer<E>> jsonContainer<E extends Object>(
249249
String name, {
250250
required ToJson<E> toJson,
251251
required FromJson<E> fromJson,
@@ -303,7 +303,7 @@ class HyperStorage extends _HyperStorageImpl {
303303
///
304304
/// See also:
305305
/// - [container] for basic storage containers
306-
/// - [jsonSerializableContainer] for JSON serialization
306+
/// - [jsonContainer] for JSON serialization
307307
/// - [SerializableStorageContainer] for the base container class
308308
Future<F> objectContainer<E extends Object, F extends SerializableStorageContainer<E>>(
309309
String name, {

packages/hyper_storage/lib/src/json_storage_container.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ typedef ToJson<E> = Map<String, dynamic> Function(E object);
5757
///
5858
/// See also:
5959
/// - [SerializableStorageContainer] for the base class
60-
/// - [HyperStorage.jsonSerializableContainer] for creating instances
60+
/// - [HyperStorage.jsonContainer] for creating instances
6161
/// - [FromJson] and [ToJson] typedefs for serialization functions
6262
/// - [IdGetter] for custom ID extraction
6363
final class JsonStorageContainer<E extends Object> extends SerializableStorageContainer<E> {
@@ -113,7 +113,7 @@ final class JsonStorageContainer<E extends Object> extends SerializableStorageCo
113113
/// on the backend is used.
114114
///
115115
/// Note: Typically, you would create containers using
116-
/// [HyperStorage.jsonSerializableContainer] rather than calling this
116+
/// [HyperStorage.jsonContainer] rather than calling this
117117
/// constructor directly, as that method handles caching and ensures
118118
/// singleton behavior per container name.
119119
JsonStorageContainer({

packages/hyper_storage/test/hyper_storage_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ void main() {
413413
test('clear removes all data from storage and containers', () async {
414414
final storage = HyperStorage.instance;
415415
final container = await storage.container('test');
416-
final jsonContainer = await storage.jsonSerializableContainer<User>(
416+
final jsonContainer = await storage.jsonContainer<User>(
417417
'users',
418418
toJson: (user) => user.toJson(),
419419
fromJson: User.fromJson,
@@ -715,15 +715,15 @@ void main() {
715715
final storage = HyperStorage.instance;
716716

717717
// Create a container for User type
718-
await storage.jsonSerializableContainer<User>(
718+
await storage.jsonContainer<User>(
719719
'users',
720720
toJson: (user) => user.toJson(),
721721
fromJson: User.fromJson,
722722
);
723723

724724
// Try to create another container with same name but different type
725725
expect(
726-
() => storage.jsonSerializableContainer<Product>(
726+
() => storage.jsonContainer<Product>(
727727
'users',
728728
toJson: (product) => product.toJson(),
729729
fromJson: Product.fromJson,

0 commit comments

Comments
 (0)