Skip to content

Commit

Permalink
feat: v1 localstorage polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
rayan1810 committed Oct 9, 2024
1 parent 438b8da commit 5cfe877
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,22 @@ npm install react-native-localstorage-polyfill

## Usage

Simply import react-native-localstorage-polyfill in the root of your app

```js
import { multiply } from 'react-native-localstorage-polyfill';
import 'react-native-localstorage-polyfill';
```

// ...
```js
localStorage.setItem('key', 'value');

const result = await multiply(3, 7);
localStorage.getItem('key');
```


## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License

MIT

---

Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
1 change: 1 addition & 0 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
import { StyleSheet, View, Text } from 'react-native';

export default function App() {
Expand Down
4 changes: 2 additions & 2 deletions lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ pre-commit:
parallel: true
commands:
lint:
glob: "*.{js,ts,jsx,tsx}"
glob: '*.{js,ts,jsx,tsx}'
run: npx eslint {staged_files}
types:
glob: "*.{js,ts, jsx, tsx}"
glob: '*.{js,ts, jsx, tsx}'
run: npx tsc
commit-msg:
parallel: true
Expand Down
11 changes: 8 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@
"compilerOptions": {
"rootDir": ".",
"paths": {
"react-native-localstorage-polyfill": ["./src/index"]
"react-native-localstorage-polyfill": [
"./src/index"
]
},
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"jsx": "react-jsx",
"lib": ["ESNext"],
"lib": [
"ESNext",
"DOM"
],
"module": "ESNext",
"moduleResolution": "Bundler",
"noEmit": true,
Expand All @@ -26,4 +31,4 @@
"target": "ESNext",
"verbatimModuleSyntax": true
}
}
}

0 comments on commit 5cfe877

Please sign in to comment.