generated from Alorel/basic-library-template-repo
-
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
Showing
8 changed files
with
165 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
/** @internal */ | ||
export * from './ActionDispatchedEvent'; | ||
|
||
/** @internal */ | ||
export * from './ActionProcessedEvent'; | ||
|
||
/** @internal */ | ||
export * from './InitialStateEvent'; | ||
|
||
/** @internal */ | ||
export * from './ReadyEvent'; | ||
export * from './ReduxOMTEvent'; |
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
13 changes: 13 additions & 0 deletions
13
projects/core/main-thread/lib/wrapped-store/WrappedStore.ts
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 |
---|---|---|
@@ -1,5 +1,18 @@ | ||
import {Action, AnyAction, Store} from 'redux'; | ||
|
||
/** A Redux store wrapped to run off the main thread */ | ||
export type WrappedStore<S, A extends Action = AnyAction> = Store<S, A> & { | ||
|
||
/** | ||
* Actions no longer mutate the state synchronously, therefore the store no longer behaves exactly as a regular | ||
* Redux store: | ||
* <code> | ||
* const oldState = store.getState(); | ||
* store.dispatch({type: 'some-valid-action-that-should-mutate-the-state''}); | ||
* // True on an off-main-thread store, false on a regular store | ||
* console.log(oldState === store.getState()); | ||
* </code> | ||
* This method can be used to react to when the store off the main thread | ||
*/ | ||
onChange(listener: (action: A, newState: S, oldState: S) => void): () => void; | ||
} |
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