File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,16 +13,18 @@ export const CoreStateContext = createContext<{
1313
1414export interface CoreProviderProps {
1515 coreStore : CoreStore ;
16+ transition : boolean ;
1617 children : JSXElement ;
1718}
1819export const CoreProvider : Component < CoreProviderProps > = ( props ) => {
1920 const [ stack , setStack ] = createStore ( props . coreStore . actions . getStack ( ) ) ;
2021 const [ pending , startTransition ] = useTransition ( ) ;
2122
2223 props . coreStore . subscribe ( ( ) => {
23- startTransition ( ( ) => {
24+ const update = ( ) =>
2425 setStack ( reconcile ( props . coreStore . actions . getStack ( ) , { merge : true } ) ) ;
25- } ) ;
26+ if ( props . transition ) startTransition ( update ) ;
27+ else update ( ) ;
2628 } ) ;
2729
2830 return (
Original file line number Diff line number Diff line change @@ -3,4 +3,5 @@ import type { Component } from "solid-js";
33export type StackComponentType = Component < {
44 initialContext ?: any ;
55 initialLoaderData ?: any ;
6+ transition ?: boolean ;
67} > ;
Original file line number Diff line number Diff line change @@ -149,7 +149,10 @@ export function stackflow<
149149 return (
150150 < ConfigProvider value = { input . config } >
151151 < PluginsProvider value = { coreStore . pluginInstances } >
152- < CoreProvider coreStore = { coreStore } >
152+ < CoreProvider
153+ coreStore = { coreStore }
154+ transition = { props . transition ?? true }
155+ >
153156 < MainRenderer
154157 activityComponentMap = { input . components }
155158 initialContext = { initialContext ( ) }
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import { useStepActions } from "./useStepActions";
2525
2626export type StackComponentType = Component < {
2727 initialContext ?: any ;
28+ transition ?: boolean ;
2829} > ;
2930
3031type StackflowPluginsEntry < T extends BaseActivities > =
@@ -197,7 +198,10 @@ export function stackflow<T extends BaseActivities>(
197198
198199 return (
199200 < PluginsProvider value = { coreStore . pluginInstances } >
200- < CoreProvider coreStore = { coreStore } >
201+ < CoreProvider
202+ coreStore = { coreStore }
203+ transition = { props . transition ?? true }
204+ >
201205 < MainRenderer
202206 activityComponentMap = { activityComponentMap }
203207 initialContext = { props . initialContext }
You can’t perform that action at this time.
0 commit comments