clean_data 0.4.16 clean_data: ^0.4.16 copied to clipboard
Support for automatical data synchronization among collections.
import 'package:clean_data/clean_data.dart';
import 'dart:async';
main (){
var data = new DataMap.from({'id': '123', 'name': 'jano', 'age': 30});
// lsiten on whole Map's changes
data.onChange.listen((change) => print('data changed'));
// listen more specifically on Map's 'name' key
data.ref('name').onChange.listen((change) => print('name changed'));
print('changing age');
data['age']++;
new Future.delayed(new Duration(seconds: 5), (){
print('changing name');
data['name'] = 'Jano';
});
}