question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[feature] custom onSave implementation

See original GitHub issue

Hey!

Is there a way to define custom callback when data is saved/updated?

Consider a situation when a collection or document are read-only, write operations can be only done server-side.

read: true;
write: false;

onSaveSuccess and onPreSave are hooks around client-side save operation.

For example, custom save operation would let us perform calls to an API to update data.

Something like this defined on Schema maybe?

onSave = async ({ newValues }) => {
  await updateData(...)
  // if throws - display snackbar
    
  return newValues;
};

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
fgatti675commented, Sep 8, 2021

Quick update in case someone is interested. We are currently working on a way to override the complete datasource implementation, allowing you to add your custom logic and even replace the whole Firestore implementation for a different one.

0reactions
shelooks16commented, Oct 1, 2021

Thanks for letting me know! Gonna keep an eye on this 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Understand SharePoint forms integration - Power Apps
Customize the default form​​ Here are some things to keep in mind when you customize forms: Use the OnSave formula of the SharePointIntegration ......
Read more >
PowerApps: How to Customize "Save" and "Cancel" Buttons
Add "Save" and "Cancel" Buttons to SharePoint Online List Forms. Click "Customize" either from an item form or the list command bar to...
Read more >
How to Correctly Save the State of a Custom View in Android
I just pass the super state and set childrenStates using the saveChildViewStates extension function.
Read more >
Async OnSave handlers in DataVerse/ Dynamics 365 forms to ...
With onsave event handlers, the following requirements frequently come up. Cancel save event of form in based on custom validations from server side....
Read more >
What's "Onchange", "Onsave" and "Onload" in CRM
These are a few of the events you can tie your custom code into. OnChange - the event when a field value changes...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found