// If you only want to subscribe to Observables once (the Observables don't depend on outer props), // pass `null` to `triggerProps`. If `triggerProps` change, renders will also be paused until the new Observables emit first values. // The inner component will not render until all supplied Observables return their first values. You can also return arbitrary objects that have // an `observe()` function that returns an Observable. // You can return multiple Observables in the function. // Every time one of the Observables emits a new value, the matching inner prop is updated. 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.WithObservables ( triggerProps, getObservables ) // Injects new props to a component with values from the passed Observables // // Every time one of the `triggerProps` changes, `getObservables()` is called // and the returned Observables are subscribed to. 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 □ Check off tasks as you complete them, tap the star icon. OTOH I don’t think that depending on DB config is that wrong.ĭescendants is a confusing word for non-fluent English speakers Read MoreYoull start off in your Nozbe Inbox, where youll see any tasks that arent in a project. 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. ![]() The following APIs would be deprecated and removed in a later version: Model.prepareMarkAsDeleted Overwrite the default by explicitly stating the desired behavior: await model.remove()ĭo we even need this? Does anyone care about running this remove in a single batch with other changes? Deprecations & removals ![]() UPDATE: Unless I’m missing something, delete is only a keyword contextually so we actually can name the method delete() Marking as deleted / destroying permanently: (I’m open to feedback, we can pick another word). Remove is used to avoid using delete, because it’s a JS keyword. Remove() can only be called inside a writer action. To find your API key, enter your Nozbe email and password in this link and enter it in another tab in your browser: https. This, by default, marks as deleted the model and all of its descendants. Finally, high performance deletion of large trees of records ( currently not possible). ![]() Deprecate (and eventually remove) existing markAsDeleted, destroyPermanently, experimentalMarkAsDeleted, experimentalDestroyPermanently methods (which can be confusing).Unified, simple, nice, understandable API for deleting records.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |