-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add useMutableSource and useOpaqueIdentifier hooks (#64)
* Add useMutableSource hook * Add useOpaqueIdentifier * Memoize opaque identifiers * Add useOpaqueIdentifier hook to Dispatcher
- Loading branch information
Showing
6 changed files
with
77 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
|
||
export * from './context' | ||
export * from './error' | ||
export * from './state' | ||
export * from './dispatcher' |
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,12 @@ | ||
// @flow | ||
|
||
import type { RendererState } from '../types' | ||
|
||
/** The current global renderer state per render cycle */ | ||
export const rendererStateRef: {| current: RendererState |} = { | ||
current: { uniqueID: 0 } | ||
} | ||
export const initRendererState = (): RendererState => | ||
(rendererStateRef.current = { uniqueID: 0 }) | ||
export const setCurrentRendererState = (state: RendererState) => | ||
(rendererStateRef.current = state) |
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