Make callbackdemo slightly more impressive

This commit is contained in:
Tim Van Baak 2020-06-08 22:42:39 -07:00
parent 128cc7b1f9
commit 0b3eb33d42
1 changed files with 3 additions and 2 deletions

View File

@ -12,9 +12,10 @@ def fetch_new(state):
'id': itemid,
'title': f"Callback demo",
'body': 'No callbacks',
'callback': { 'id': itemid }
'callback': { 'count': 0 }
}
return [item]
def callback(state, item):
item['body'] = f"Last callback at {datetime.now()}"
item['callback']['count'] += 1
item['body'] = f"Last callback at {datetime.now()}, {item['callback']['count']} total callbacks"