I want to build a notebook which lets the user mess around with some data - load JSON from a URL, view it in a table, select some items, maybe use their own custom JavaScript to map/filter it in some ways… and then click a button to save that data to a backend API via a fetch() call.
Crucially, I don’t want to automatically POST to that backend every time the user changes anything else in the notebook: I want a “Save” button that is a very deliberate action, which the user clicks only when they are ready to submit their final modified data.
Most API examples in Observable are reactive, because they are usually fetching data from an API where sending multiple requests isn’t a problem.
In my case the POST I make to my backend is a mutation operation, so I want the user to be in full control of when it happens.
It looks like Button Input / Observable Inputs / Observable / Observable is the right tool to use here, but its documentation doesn’t show a pattern that feels quite right for what I’m trying to achieve.
Anyone got a good example notebook that does something like this?
Basically I want a good, robust pattern for “When the user clicks this button, run this fetch() POST request”.