Skip to content

Commit

Permalink
fix: fix storage context when using configure
Browse files Browse the repository at this point in the history
  • Loading branch information
philippkuehn committed Oct 24, 2021
1 parent da2d3d4 commit ef254ce
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/core/src/Extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,15 @@ export class Extension<Options = any, Storage = any> {

extension.options = mergeDeep(this.options, options) as Options

extension.storage = callOrReturn(getExtensionField<AnyConfig['addStorage']>(
extension,
'addStorage',
{
name: extension.name,
options: extension.options,
},
))

return extension
}

Expand Down
9 changes: 9 additions & 0 deletions packages/core/src/Mark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,15 @@ export class Mark<Options = any, Storage = any> {

extension.options = mergeDeep(this.options, options) as Options

extension.storage = callOrReturn(getExtensionField<AnyConfig['addStorage']>(
extension,
'addStorage',
{
name: extension.name,
options: extension.options,
},
))

return extension
}

Expand Down
9 changes: 9 additions & 0 deletions packages/core/src/Node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,15 @@ export class Node<Options = any, Storage = any> {

extension.options = mergeDeep(this.options, options) as Options

extension.storage = callOrReturn(getExtensionField<AnyConfig['addStorage']>(
extension,
'addStorage',
{
name: extension.name,
options: extension.options,
},
))

return extension
}

Expand Down

0 comments on commit ef254ce

Please sign in to comment.