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.

"grouped" transforms

See original GitHub issue

Here’s an idea for people to think about…

Right now we have transforms, and if you want to do an async transform, we say just later on call editor.onChange(newState). This works fine for applying the transform.

But in terms of the history, this ends up with a weird result, where a new change is inserted at a potentially later time, not when the user was expecting it. Usually it’s not really an issue, but if the async task takes a while to complete, there might be other transforms that have occurred since. Or if the original change was a “two part” change, now you’ve got this extra undo step that puts it in an indeterminate state…

For example:

  • User pastes an image file.
  • Transform: insert an image_block with data.file = file
  • Transform: read the file locally and set data.preview = dataUri
  • Upload the file to your server
  • Transform: set data.url = url when the upload completes

Now you’ve got three different undo steps. The first change was when the user actually committed the action. The second one was when there the first visual feedback for their action being completed. And the third is when the data is actually “saved/stable” as far as your data model is concerned.

You probably don’t want the user to be able to undo in steps.

It would be cool if there was a way to “defer” operations in a transform. Such that you could create one initial transform, and later add operations to it, so that they are grouped into a single undo step.

Not sure what the API might look like. Thoughts welcome!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
yalucommented, May 5, 2017

I might be totally out of line but, if each save point has an id, async transform could refer it to save(group) itself with that save point.

1reaction
yalucommented, May 5, 2017

Nevermind the question about “merge” and “save”.

I just realized setting “merge” and “save” won’t cut it if some other transform happens in-between.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pandas.core.groupby.DataFrameGroupBy.transform
Returns a DataFrame having the same indexes as the original object filled with the transformed values. Parameters. ffunction. Function to apply to each...
Read more >
Grouping Transformations - NRICH
An introduction to groups using transformations, following on from the October 2006 ... A group is a set G together with a binary...
Read more >
How to Use the Group Transform - Grow Help Center
This is a two-step process: First, select the column(s) you want to group by, and then select other columns and how you want...
Read more >
Modern Algebra: transformation groups - Clark University
Summary of transformation groups. The group of isometries of the Euclidean plane is an example of a transformation group. In general, a transformtion...
Read more >
Transform Data by (Grouped) Replacing or Sweeping out... - R
TRA is an S3 generic that efficiently transforms data by either (column-wise) replacing data values with supplied statistics or sweeping the statistics out...
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