Skip to content
This repository has been archived by the owner on May 7, 2023. It is now read-only.

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
synw committed May 3, 2019
1 parent 26f791f commit bb793f3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,20 +148,25 @@ A map that will auto save it's values to the database. Useful for values that
mostly get updated, like settings

```dart
import 'package:observable/observable.dart';
import 'package:sqlcool/sqlcool.dart';
// Define the map with initial data
var myMap = SynchronizedMap(
db: db, // an Sqlcool database
table: "a_table",
where: "id=1",
data: ObservableMap.from({"k": "v"}),
columns = "col1,col2,col3",
verbose: true
);
// Wait until the map is initialized
await myMap.onReady;
// Changing the map will auto update the data in the database:
myMap.data["k"] = "v2";
myMap.data["col1"] = "value";
// Dispose the map when finished using
myMap.dispose();
```

## Todo
Expand Down

0 comments on commit bb793f3

Please sign in to comment.