- Added a
loadMore
function to theuseSubscribe
hook to fetch more events. - Added a
hasMore
boolean to theuseSubscribe
hook to check if there are more events to fetch.
- Fixed a typo from
loginWithExtention
tologinWithExtension
.
- Fixed a typo from
loginWithExtention
tologinWithExtension
. Now you need to useloginWithExtension
instead ofloginWithExtention
.
- Added support for custom NDK instances. Now you can pass a custom NDK instance to all the hooks, but you need to execute
ndk.connect()
manually once you create a custom NDK instance.
- Replaces
useProfiles
withuseProfile
hook. - Added
useAutoLogin
hook. - Bug fixes for
useLogin
hook. - Bug fixes for setting ndk signer.
- Refactor store.
- Replaces
useProfiles
withuseProfile
hook. Now you can useuseProfile
hook to fetch a single profile by address. - Replaces
reLoginFromLocalStorage
withloginFromLocalStorage
.
- Improved
useSubscribe
hook to react to the changes in the input parameters.
useSubscribe
hook is now sensitive to all the input parameters. If any of the input parameters change, the hook will unsubscribe from the previous subscription and subscribe to the new one. This will help you to subscribe to different filters based on the input parameters. You need to make sure that the input parameters are memoized and don't change on every render to avoid infinite re-render loops. You can find examples in README.useNostrHooks
hook is now sensitive to the initial NDK instance parameter. You need to make sure that the initial NDK instance is memoized and doesn't change on every render to avoid infinite re-render loops. You can find examples in README.
- Improved interacting with different signers.
- Added
useSigner
hook. - Added
useLogin
hook. - Removed
useNip07
hook.
- Extracted signer related functionalities from
useNDK
hook touseSigner
hook. Now you need to importsetSigner
method fromuseSigner
hook instead ofuseNDK
hook. - Removed
useNip07
hook. Now you can useuseLogin
hook to login with extension (NIP-07).
- Added
fetchProfiles
boolean touseSubscribe
hook to fetch profiles on subscription.
- It reverts replacing
Zustand
store with theReact Context API
. Now, you don't need to wrap your application with theNostrHooksContextProvider
component. but you need to initialize NostrHooks withuseNostrHooks
hook. You can find more information about this change in readme. - It reverts using
Immer
for updating NDK instance inuseNDK
hook, and usesCloneDeep
fromlodash
to update the NDK instance.
- Using Immer for updating NDK instance in
useNDK
hook. This will require you to update your code to use the newproduce
function fromimmer
to update the NDK instance. This is a breaking change because the oldsetState
function is no longer available. You can find more information about this change in the README, and Immer documentation.
-
It replaces the
Zustand
store with theReact Context API
. This means that now you need to wrap your application with theNostrHooksContextProvider
component. -
It replaces
nostr-tools
withnostr-dev-kit (NDK)
. This means that most of the functionalities like caching, batching, and merging filters are now handled by NDK and Nostr-Hooks is only responsible for managing the component state and subscriptions.