image icon indicating copy to clipboard operation
image copied to clipboard

Pass remove lifecycle hook to config.onRemove

Open MohitKS5 opened this issue 4 years ago • 10 comments

Called onRemove function in remove life cycle hook.

  removed() {
    this.config.onRemove(this.data);
  }

Usage

  • Replace the contents of node-modules/@editorjs/image/dist/bundle.js by dist/bundle.js of this repository.
{
  image: {
    class: Image,
    config: {
      onRemove: data => console.log(data)
    }
   // other config options
}

PS: I don't think this would be merged with read-only branch, but this works great as a workaround.

MohitKS5 avatar Jun 14 '20 05:06 MohitKS5

Hi @MohitKS5!

Thank you for your pull request. Before merging please complete the following things in PR:

  • Update version package.json
  • Update README.md according to changes
  • Build the image tool using yarn build for production mode

robonetphy avatar Jul 23 '20 16:07 robonetphy

I did the changes. Is specifying @param {object} and providing link to format (output data section) is sufficient or should I re-describe it in the section ?

MohitKS5 avatar Jul 29 '20 04:07 MohitKS5

pulled master and rebuilt for production. The only conflict was package.json version. There are warnings on build but I didn't introduce any new warning. I checked by building the master itself.

MohitKS5 avatar Jul 30 '20 00:07 MohitKS5

Still has conflicts

neSpecc avatar Jul 30 '20 09:07 neSpecc

Sorry, I forgot to check the upstream, pulled master of my own fork only. Its fixed now.

MohitKS5 avatar Jul 30 '20 10:07 MohitKS5

Hi @MohitKS5, Please Resolve the conflicts and change version in package.json again

robonetphy avatar Aug 04 '20 18:08 robonetphy

@robonetphy done.

MohitKS5 avatar Aug 07 '20 00:08 MohitKS5

Is this still being worked on?🥲

Theminijohn avatar Jan 09 '21 00:01 Theminijohn

look forward

2ik avatar Feb 25 '21 20:02 2ik

Called onRemove function in remove life cycle hook.

  removed() {
    this.config.onRemove(this.data);
  }

Will these changes be included in the main thread in the repository?

ghost avatar Oct 28 '22 10:10 ghost