-
added
useContext
Added the
useContext
hook to use theBuildContext
inside other hooks -
added
HookWidget
Added the
HookWidget
class to use class Widget with hooks. HookWidget is now use as the base for the HookBuilder class.
There is a lot of change in this version. This is not a major release because there are no change in the design or new functionality, excluding hot reload support (but yes, something will break updating to the new version).
This is a better implementation how make more clear the goal to avoid the use of classes and mixin and prefer instead hook functions and composition.
The change came also from the necessity to make a better division of responsibility.
-
removed
Hook.dispose
.Logic moved to a new
_DisposableController
, how is private, because we don't want developers use class extension or mixin. Sorry if someone was usingHook.dispose
compose usinguseEffect
instead. -
replaced
HookState
withStateController
It's a better name, and describe better the returned value of
useState
. -
deprecated
HookState.set
(nowStateController.set
), useStateController.value = newValue instead
-
useState
now returnStateController
instead of 'HookState' -
useMemo
now implements the dispose lifecycle -
useEffect
--like all the hooks functions-- useuseMemo
-
added hot reload support
When the hock type change, because an hook function is added, removed, or change type, the hook will be disposed and reset to null. There will be no break hot reloading the app. But will be other side effects.
We decide to not make hooks shift to the next position, because we prefer to have the same behavior in the case you add, remove, or change an hook function call.
-
Added Hot Reload test
-
Added Hot Reload and Changelog section to README
We are also thinking to make use
private.
Everything can be done using useMemo
now.
- flutter packages get error fix
- added useEffect hook function
- better dartdoc comment
- better readme
- added travis integration
- added test for useEffect
- added test for hooks function scope
- Initial Release