@@ -12,23 +12,17 @@ public struct StaticStorePreviewContext {
1212 }
1313
1414 public func makeStateAccessor< State> ( state: State ) -> StateAccessor < State > {
15- StateAccessor (
16- state: state,
17- sendValue: { _ in }
18- )
15+ . static( state: state)
1916 }
2017
2118 public func makeActionModel< State, Action> (
2219 state: State
2320 ) -> ActionModel < State , Action > {
24- ActionModel (
25- accessor: makeStateAccessor ( state: state) ,
26- sendAction: makeSink ( of: Action . self) . send
27- )
21+ . static( state: state)
2822 }
2923}
3024
31- extension Store {
25+ public extension Store {
3226 /// Generates a static store for previews.
3327 ///
3428 /// Previews generated with this method are static and do not update state. To generate a
@@ -38,15 +32,15 @@ extension Store {
3832 /// - Parameter makeModel: A closure to create the store's model. The provided `context` param
3933 /// is a convenience to generate dummy sinks and state accessors.
4034 /// - Returns: A store for previews.
41- public static func preview(
35+ static func preview(
4236 makeModel: ( StaticStorePreviewContext ) -> Model
4337 ) -> Store {
4438 let context = StaticStorePreviewContext ( )
4539 let model = makeModel ( context)
4640 let ( store, _) = make ( model: model)
4741 return store
4842 }
49-
43+
5044 /// Generates a static store for previews.
5145 ///
5246 /// Previews generated with this method are static and do not update state. To generate a
@@ -55,14 +49,14 @@ extension Store {
5549 ///
5650 /// - Parameter state: The state of the view.
5751 /// - Returns: A store for previews.
58- public static func preview< State, Action> (
52+ static func preview< State, Action> (
5953 state: State
6054 ) -> Store < ActionModel < State , Action > > where Model == ActionModel < State , Action > {
6155 preview { context in
6256 context. makeActionModel ( state: state)
6357 }
6458 }
65-
59+
6660 /// Generates a static store for previews.
6761 ///
6862 /// Previews generated with this method are static and do not update state. To generate a
@@ -71,7 +65,7 @@ extension Store {
7165 ///
7266 /// - Parameter state: The state of the view.
7367 /// - Returns: A store for previews.
74- public static func preview< State> (
68+ static func preview< State> (
7569 state: State
7670 ) -> Store < StateAccessor < State > > where Model == StateAccessor < State > {
7771 preview { context in
0 commit comments