![]() Google's calendar is better than I thought it would be initially. Nozbe unfortunately, and despite doing the next action / list management thing exceptionally well, has not added sms or email reminders to their calendar so I use SaiSuke iPhone app to sync with the Google Calendar instead of Nozbe for all calendar related items. They do a fantastic job!ĪLL TIME/DATE SENSITIVE with SMS and Gmail reminding. The best so far for me, seems to be the native Nozbe iPhone application for managing my next action and project lists. ![]() I think adding a removeSection method that implements a custom behavior is enough and could even be superior if for example you need 2 different methods like removeSection and removeSectionWithTasks.I have tried many things for calendaring and next actions on the iPhone. I don't see a reason to add such "hooks". However this also means that you would rarely need to use childrenToRemove method so it might as well be flexible. Powerful and might be necessary for some more complex app schemas, but it might also prevent someĬould you think of an example when this would be useful? In most cases removing descendants is straightforward. I'm also considering changing the definition so that instead of a simple static definition of children,Īn asynchronous function that returns actual records (not just a query) is used. We could use children even though it's not technically correct, but I think users will be fine with descendants :) OTOH I don't think that depending on DB config is that wrong.ĭescendants is a confusing word for non-fluent English speakers The only drawback is that you have to remember about it when declaring a new model, but that doesn't happen that often. ![]() This way model behaviour doesn't depend on db configuration and user even can specify only some models as removed permanently by default. Other solution could be to add a static property static removePermanentlyByDefault = true when defining a new model. And any library code to work with WatermelonDB would have to explicitly declare whether a remove is meant to be permanent or not. I'd rather Model methods not have knowledge about Database configuration, and behave differently based on it. I'm not entirely sure if this is the right design. ![]() This complicates the API, since we must split the remove operation into an asynchronous preparation of the list of records to remove, and a synchronous marking of those records. A requirement of prepareX methods is that they must be called synchronously with batch()… while remove() must be asynchronous. BatchingĬurrently, we can call record.prepareMarkAsDeleted() / record.prepareDestroyPermanently() to be able to make that change transactionally in a single batch with other changes. WDYT? I'm curious to hear other apps' use cases, maybe we do need some generic mechanism for this after all. This would preserve desired behavior for deleting the entire Project. I think in this case, the simplest thing to do is to create a custom removeSection method with this special behavior we can call on an individual section, and prevent users from accidentally calling section.remove(). This makes me doubt that we want to have an "on delete" API anyway. So how do we prevent this onRemove action to be called without breaking other use cases? When do we wait for onRemove to be executed? How do we ensure that onRemove doesn't change or remove records that we've just deleted/are about to delete? How would that work with Batching? We don't want sections' tasks to be moved to "without section", because they also get deleted. However, there's a complication: if we want to remove the entire Project, we want to remove all its descendants, including all its tasks, and sections. I t would probably be possible to override it with In that case, remove() destroys permanently by default. , // Not sure how to call this parameter, two ideas: removePermanentlyByDefault: true, // explicit name syncable: false, // more generic, could also control other behavior differences (can be a pro or con, not sure) } )
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |