Releases: junerver/ComposeHooks
hooks2:2.1.0
NOTE: This project has been migrated to Kotlin Mutliplatform, and the artifact id uploaded to Maven central has been changed to hooks2
Please see the wiki for migration notes
- upgrade kotlin -> 2.1.0
- fix #25
- optimization
- migrate to KMP #26
- Reduced the use of tuples as return types for hooks
- Introduced new parameters
debounceOptionsOf
andthrottleOptionsOf
inRequestOptions
- Extended set/get delegate functions for
PersistentHolder
,Ref
, andMutableRef
- Refactored
usePersistent
- Refactored
unwrap
- Exposed
HooksEventManager
to allow communication between non-Compose and Compose sides via events - Added a new hook:
useImmutableList
- Refactored
useRequest
- fix: #29
- deprecated hooks are marked as private
- breaking change: use
State<T>
to wrap the return value of hooks - breaking change: Some set function property types changed from
StateValueFn<T>
toStateValueFn<Either<T, (T) -> T>>
注意:该项目已迁移到 Kotlin Mutliplatform,上传到 Maven central 的工件 ID 已更改为 hooks2
请参阅 wiki 了解迁移说明
- 升级 kotlin -> 2.1.0
- 修复 #25
- 优化
- 迁移到 KMP #26
- 减少了使用元组作为钩子的返回类型
- 在
RequestOptions
中引入了新参数debounceOptionsOf
和throttleOptionsOf
- 扩展了
PersistentHolder
、Ref
和MutableRef
的 set/get 委托函数 - 重构了
usePersistent
- 重构了
unwrap
- 公开了
HooksEventManager
以允许非 Compose 端和 Compose 端通过事件进行通信 - 添加了新钩子:
useImmutableList
- 重构了
useRequest
- 修复:#29
- 弃用的钩子被标记为私有
- 重大更改:使用
State<T>
包装 hooks 的返回值 - 重大更改:一些设置函数属性类型从
StateValueFn<T>
更改为StateValueFn<Either<T, (T) -> T>>
2.0.3
hooks2:2.1.0-beta1
NOTE: This project has been migrated to Kotlin Mutliplatform, and the artifact id uploaded to Maven central has been changed to hooks2
Please see the wiki for migration notes
- fix: #29
- deprecated hooks are marked as private,
- upgrade kotlin to 2.1.0
- Some set function property types changed from
StateValueFn<T>
toStateValueFn<Either<T, (T) -> T>>
(break change)
注意:该项目已迁移到 Kotlin Mutliplatform,上传到 Maven central 的工件 ID 已更改为 hooks2
请参阅 wiki 了解迁移说明
- 修复:#29
- 弃用的钩子被标记为私有
- 将 kotlin 升级到 2.1.0
- 一些设置函数属性类型从
StateValueFn<T>
更改为StateValueFn<Either<T, (T) -> T>>
(破坏性更新)
hooks2:2.1.0-alpha1
- Reduced the use of tuples as return types for hooks
- Introduced new parameters
debounceOptionsOf
andthrottleOptionsOf
inRequestOptions
- Extended set/get delegate functions for
PersistentHolder
,Ref
, andMutableRef
- Refactored
usePersistent
- Refactored
unwrap
- Exposed
HooksEventManager
to allow communication between non-Compose and Compose sides via events - Added a new hook:
useImmutableList
- Refactored
useRequest
- 减少了使用元组作为钩子的返回类型
- 在
RequestOptions
中引入了新参数debounceOptionsOf
和throttleOptionsOf
- 扩展了
PersistentHolder
、Ref
和MutableRef
的 set/get 委托函数 - 重构了
usePersistent
- 重构了
unwrap
- 公开了
HooksEventManager
以允许非 Compose 端和 Compose 端通过事件进行通信 - 添加了新钩子:
useImmutableList
- 重构了
useRequest
hooks2:2.1.0-alpha0
NOTE: This project has been migrated to Kotlin Mutliplatform, and the artifact id uploaded to Maven central has been changed to hooks2
Please see the wiki for migration notes
- upgrade kotlin -> 2.0.20
- fix #25
- optimization
- migrate to KMP
- breaking change:use
State<T>
to wrap the return value of hooks
注意:该项目已迁移到 Kotlin Mutliplatform,上传到 Maven central 的工件 ID 已更改为 hooks2
请参阅 wiki 了解迁移说明
- 升级 kotlin -> 2.0.20
- 修复 #25
- 优化
- 迁移到 KMP
- 重大更改:使用
State<T>
包装 hooks 的返回值
2.0.2
- optimization
- complete swr/cache
This is the last release of id: hooks
. If there are any bugs in the future, they will be fixed. The subsequent version numbers are all 2.0.x
.
hooks2
is fully migrated to KMP. The first official version will start from 2.1.0
. hooks2
has many destructive updates. If your project has not encountered performance problems caused by too much reorganization, or if you are a pure Android project, you do not need to migrate to hooks2
- 一些优化
- 完善 useRequest 的 swr、缓存
这是 id: hooks
的最后一个发行版,后续如果存在bug,会进行修复,后续的版本号都在 2.0.x
。
hooks2
全面迁移到 KMP,第一个正式版将从 2.1.0
开始,hooks2
由很多破坏性更新,如果你的项目还没有出现过多重组带来的性能问题,或者你是纯Android项目,可以不必迁移到 hooks2
2.0.1
- Added a function to get the validation
State
inFormScope
:FormInstance._isValidated(): State<Boolean>
- Top-level function
useForm
is deprecated, now you need to useForm.useForm
- Add new hook:
Form.useWatch
, with this hook, you can observe the specified field outside ofFormScope
as a read-only state - Add new hook:
Form.useFormInstance
, with this hook, you can getFormInstance
in any child component underFormScope
- Add new hook:
useBiometric
,through this hook you can conveniently use biometric, such as fingerprints - Fix
useEvent
, fix the issue that the subscription function throws aClassCastException
after upgrading to Kotlin 2.0.0 #24
- 在
FormScope
中添加获取表单校验状态(State
)的函数:FormInstance._isValidated(): State<Boolean>
- 顶级函数
useForm
已弃用,现在需要使用Form.useForm
- 增加新钩子:
Form.useWatch
,通过此钩子,您可以将FormScope
之外的指定字段作为只读状态进行观察 - 增加新钩子:
Form.useFormInstance
,通过此钩子,您可以在FormScope
下的任何子组件中获取FormInstance
- 增加新钩子:
useBiometric
,通过此钩子您可以方便地使用生物识别,例如指纹 - 修复
useEvent
,修复升级到 Kotlin 2.0.0 后订阅函数抛出ClassCastException
的问题 #24
2.0.0
- Upgrade kotlin 2.0.0
- Refactor
usePersistent
- Add
useBuildInfo
\useBatteryInfo
\useScreenInfo
\useDisableScreenshot
- Add
useFlashlight
- Add
useWakeLock
\useWindowFlags
- Add
useScreenBrightness
- Add
useCounter
- Add
useCountdown
- Add
useAutoReset
- Add
useIdel
- Add
useResetState