Structures
The following structures are available globally.
-
Undocumented
See moreDeclaration
Swift
public struct ThrowingBinding<Value>
-
Undocumented
Declaration
Swift
public struct TimedoutError : Error, Equatable
-
Undocumented
Declaration
Swift
public struct Subscription
-
A loadable object that contains loading informations
See moreDeclaration
Swift
public struct LoadableContent<DataType> where DataType : Equatable
-
Undocumented
See moreDeclaration
Swift
public struct Atom<T> : SyncAtomNode, Writeable where T : Equatable
-
Undocumented
See moreDeclaration
Swift
public struct AsyncAtom<T> : AsyncAtomNode, Writeable where T : Equatable
-
Undocumented
Declaration
Swift
public struct RecoilParamNode<P, Node> where Node : RecoilNode
-
Undocumented
See moreDeclaration
Swift
public struct SourcePosition : Hashable
-
A
selector
is a pure function that accepts atoms or other sync selectors as input. When these upstream atoms or sync selectors are updated, the selector function will be re-evaluated. Components can subscribe to selectors just like atoms, and will then be re-rendered when the selectors change. Selectors are used to calculate derived data that is based on state. This lets us avoid redundant state because a minimal set of state is stored in atoms, while everything else is efficiently computed as a function of that minimal state.
See morelet currentBooksSel = selector { accessor -> [Book] in let books = accessor.get(allBookStore) if let category = accessor.get(selectedCategoryState) { return books.filter { $0.category == category } } return books }
Declaration
Swift
public struct Selector<T> : SyncSelectorNode where T : Equatable
-
MutableSelector
is a bi-directional sync selector receives the incoming value as a parameter and can use that to propagate the changes back upstream along the data-flow graph.
See morelet tempFahrenheitState = atom(32) let tempCelsiusSelector = selector( get: { get in let fahrenheit = accessor.get(tempFahrenheitState) return (fahrenheit - 32) * 5 / 9 }, set: { context, newValue in let newFahrenheit = (newValue * 9) / 5 + 32 context.accessor.set(tempFahrenheitState, newFahrenheit) } )
Declaration
Swift
public struct MutableSelector<T> : SyncSelectorNode where T : Equatable
extension MutableSelector: Writeable
-
A
See moreAsyncSelector
is a pure function that other async selectors as input. those selector be impletemented byCombine
orasync/await
Selector
andAsyncSelector
can not allow you pass a user-defined argument, if you want to pass a customable parameters. please refer toselectorFamily
Declaration
Swift
public struct AsyncSelector<T> : AsyncSelectorNode where T : Equatable
-
Undocumented
See moreDeclaration
Swift
public struct RecoilCallbackContext
-
Undocumented
See moreDeclaration
Swift
public struct SnapshotView : View
-
Undocumented
See moreDeclaration
Swift
public struct MutableContext
-
Undocumented
See moreDeclaration
Swift
public struct RecoilRoot<Content> : View where Content : View
-
Undocumented
See moreDeclaration
Swift
public struct RecoilRootLeagcy<Content> : View where Content : View
-
Undocumented
See moreDeclaration
Swift
@propertyWrapper public struct RecoilScope : DynamicProperty
-
Undocumented
See moreDeclaration
Swift
@propertyWrapper public struct RecoilScopeLeagcy : DynamicProperty
-
Undocumented
See moreDeclaration
Swift
@propertyWrapper public struct RecoilSnapshot : DynamicProperty
-
Undocumented
See moreDeclaration
Swift
@propertyWrapper public struct RecoilScopedState<Node> : DynamicProperty where Node : RecoilNode