Skip to content

Commit a54fe07

Browse files
authored
Merge pull request #64 from trevorah/master
Update types as `get` will return null if a key is not set on android
2 parents cf54f15 + e8be191 commit a54fe07

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ DefaultPreference.set('my key', 'my value').then(function() {console.log('done')
5454
## API
5555

5656
```typescript
57-
function get(key: string): Promise<string | undefined>;
57+
function get(key: string): Promise<string | undefined | null>;
5858
function set(key: string, value: string): Promise<void>;
5959
function clear(key: string): Promise<void>;
6060
function getMultiple(keys: string[]): Promise<string[]>;

flow-typed/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ declare module "react-native-default-preference" {
99
[key: string]: string;
1010
}
1111
declare export default class RNDefaultPreference {
12-
static get(key: string): Promise<string | undefined>;
12+
static get(key: string): Promise<string | undefined | null>;
1313
static set(key: string, value: string): Promise<void>;
1414
static clear(key: string): Promise<void>;
1515
static getMultiple(keys: string[]): Promise<RNDefaultPreferenceKeys>;

index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ declare module 'react-native-default-preference' {
44
}
55

66
export default class RNDefaultPreference {
7-
static get(key: string): Promise<string | undefined>;
7+
static get(key: string): Promise<string | undefined | null>;
88
static set(key: string, value: string): Promise<void>;
99
static clear(key: string): Promise<void>;
1010
static getMultiple(keys: string[]): Promise<string[]>;

0 commit comments

Comments
 (0)