logux / client

Logux base components to build web client
https://logux.org/
MIT License
656 stars 46 forks source link

feat(create-auth): async `loading` key #80

Closed euaaaio closed 2 years ago

euaaaio commented 2 years ago

Useful at the first call of router guard:

router.beforeResolve(async to => {
  let auth = createAuth(client)
  await auth.loading
  let { isAuthenticated } = getValue(auth)
  if (isAuthenticated) {
    return true
  } else {
    return '/login'
  }
})
ai commented 2 years ago

Am I right that it is a minor update?

euaaaio commented 2 years ago

Yes. And I renamed Auth type to AuthStore for consistency (FilterStore).

ai commented 2 years ago

Yes. And I renamed Auth type to AuthStore for consistency (FilterStore).

For 0.x minor is equal to major 😅

Is it OK if I will release it together with Nano Stores 0.5?

euaaaio commented 2 years ago

For 0.x minor is equal to major 😅

🤯

Is it OK if I will release it together with Nano Stores 0.5?

🖤