-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5a7a240
commit 8c8b823
Showing
24 changed files
with
8,991 additions
and
7,008 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,4 @@ | |
|
||
module.exports = { | ||
plugins: ['prettier-plugin-ember-template-tag'], | ||
singleQuote: true, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { createComputeRef, createConstRef } from '@glimmer/reference'; | ||
import { createCapturedArgs, curry, EMPTY_POSITIONAL } from '@glimmer/runtime'; | ||
import { dict } from '@glimmer/util'; | ||
import * as vm from '@glimmer/vm'; | ||
|
||
// CurriedType only made available in vm from Ember 5.6.0. Fallback to hardcoded value. | ||
const ComponentCurriedType = vm.CurriedType?.Component || 0; | ||
|
||
export default function curryComponent(componentKlass, namedArgs, owner) { | ||
let namedDict = dict(); | ||
|
||
if (!(typeof namedArgs === 'object' && namedArgs.constructor === Object)) { | ||
throw 'Named arguments must be a simple object'; | ||
} | ||
|
||
for (const [key, descriptor] of Object.entries( | ||
Object.getOwnPropertyDescriptors(namedArgs), | ||
)) { | ||
if (descriptor.get) { | ||
namedDict[key] = createComputeRef(() => namedArgs[key]); | ||
} else { | ||
namedDict[key] = createConstRef(namedArgs[key]); | ||
} | ||
} | ||
|
||
return curry( | ||
ComponentCurriedType, | ||
componentKlass, | ||
owner, | ||
createCapturedArgs(namedDict, EMPTY_POSITIONAL), | ||
false, | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.