This repository has been archived by the owner on Oct 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds modifier managers that match Ember's modifier manager API. They can be defined by importing `setModifierManager` from `@glimmer/core`: ```ts import { modifierCapabilities, setModifierManager, } from '@glimmer/core'; ``` Also allows users to use simple functions as modifiers: ```js function scroll(element, position) { element.scrollY = position; return () => element.scrollY = 0; } ``` The function receives the element as the first argument, and any positional arguments after that. It can return a destructor, which will be called whenever the modifier is destroyed, or before it is updated and the modifier is run again. Also adds a `TrackedObject` implementation for tests, which makes life for testing a bit easier.
- Loading branch information
Chris Garrett
committed
Mar 27, 2020
1 parent
3c4efc5
commit fb70b9a
Showing
19 changed files
with
739 additions
and
145 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
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
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
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,11 @@ | ||
import { DEBUG } from '@glimmer/env'; | ||
|
||
let debugRenderMessage: undefined | ((renderingStack: string) => string); | ||
|
||
if (DEBUG) { | ||
debugRenderMessage = (renderingStack: string): string => { | ||
return `While rendering:\n----------------\n${renderingStack.replace(/^/gm, ' ')}`; | ||
}; | ||
} | ||
|
||
export default debugRenderMessage; |
Oops, something went wrong.