@boneframework/native-components 1.0.14 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,21 +4,18 @@ import AuthContext from "../contexts/auth";
4
4
  import useAuth from "../hooks/useAuth";
5
5
 
6
6
  function SessionProvider(props: object) {
7
- const [user, setUser] = useState(null);
8
- const auth = useAuth();
9
- setUser(auth.user);
7
+ const {login, logout, updateUser, user, isLoading} = useAuth();
10
8
 
11
9
  return (
12
10
  <AuthContext.Provider
13
11
  value={{
14
12
  signIn: async (authToken: string) => {
15
- auth.login(authToken);
16
- setUser(auth.user);
13
+ login(authToken);
17
14
  },
18
15
  signOut: () => {
19
- auth.logout();
20
- setUser(null);
16
+ logout();
21
17
  },
18
+ update: data => updateUser(data),
22
19
  user,
23
20
  }}>
24
21
  {props.children}
@@ -26,6 +23,4 @@ function SessionProvider(props: object) {
26
23
  )
27
24
  }
28
25
 
29
-
30
-
31
26
  export default SessionProvider;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boneframework/native-components",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "description": "Expo Components for Bone Framework",
5
5
  "main": "src/Bone.ts",
6
6
  "scripts": {