MoEngageInMemoryStorage
public struct MoEngageInMemoryStorage<Key, Value> : MoEngageStorageLocation, @unchecked Sendable where Key : Hashable, Key : Sendable, Value : Sendable
-
Create location based on provided data.
Declaration
Swift
public init(key: Key, scope: Scope)Parameters
keyThe key data stored in.
scopeThe user-default scope.
-
Create location based on provided data.
Declaration
Swift
public init(type: Value.Type, scope: Scope) where Key == ObjectIdentifierParameters
typeThe state data type.
scopeThe location scope.
-
Load data for provided instance.
Declaration
Swift
public func load(fromInstance sdkInstance: MoEngageSDKInstance) -> Value?Parameters
sdkInstanceThe SDK instnace for which to load.
Return Value
The value stored.
-
Save provided value for the instance.
Declaration
Swift
public func save(_ value: Value?, inInstance sdkInstance: MoEngageSDKInstance)Parameters
valueSaved value.
sdkInstanceThe SDK instnace for which to save.
-
Remove data in provided instance.
Declaration
Swift
public func remove(inInstance sdkInstance: MoEngageSDKInstance)Parameters
sdkInstanceThe SDK instnace for which to remove.
-
Declaration
Swift
public typealias Scope = MoEngageStorage.InMemoryStorage<Key, Value>.Scope