Comments (6)
try this following:
setStorageType(widnow.localStorage)
from little-state-machine.
not supporting indexdb at the momoment.
from little-state-machine.
Yeah, it works.
Thanks, @bluebill1049 ... I really appreciate it
from little-state-machine.
from little-state-machine.
Sorry to open this again, but can I change to storage to indexeddb
or similar? I need to storage some images and localStorage
and sessionStorage
has smaller storage to doing this.
from little-state-machine.
but, well, I think an indexeddb adapter should be easy to create:
/** This Web Storage API interface provides access to a particular domain's session or local storage. It allows, for example, the addition, modification, or deletion of stored data items. */
interface Storage {
/**
* Returns the number of key/value pairs currently present in the list associated with the object.
*/
readonly length: number;
/**
* Empties the list associated with the object of all key/value pairs, if there are any.
*/
clear(): void;
/**
* Returns the current value associated with the given key, or null if the given key does not exist in the list associated with the object.
*/
getItem(key: string): string | null;
/**
* Returns the name of the nth key in the list, or null if n is greater than or equal to the number of key/value pairs in the object.
*/
key(index: number): string | null;
/**
* Removes the key/value pair with the given key from the list associated with the object, if a key/value pair with the given key exists.
*/
removeItem(key: string): void;
/**
* Sets the value of the pair identified by key to value, creating a new key/value pair if none existed for key previously.
*
* Throws a "QuotaExceededError" DOMException exception if the new value couldn't be set. (Setting could fail if, e.g., the user has disabled storage for the site, or if the quota has been exceeded.)
*/
setItem(key: string, value: string): void;
[name: string]: any;
}
from little-state-machine.
Related Issues (20)
- When Cookies are disabled, actions.updateAction({ name: 'bill' })} throws an error- TypeError: o.storageType.setItem is not a function. The website handles Cookie Disabled error gracefully by throwing a message, but this breaks the App. How can we avoid that? HOT 1
- Does `useStateMachine` trigger re-renders when an update occurs in another component tree? HOT 5
- unable to create mock provider for Jest+React testing Lib HOT 6
- unable to clear store HOT 3
- Help with the LocalStorage and Next.JS HOT 1
- Bf a /:/66 HOT 1
- npm ERR! code ERESOLVE HOT 1
- How to push data to an array state machine HOT 2
- Code Sample in TS is not working correctly HOT 4
- Reset store to initial value ? HOT 1
- Catching Storage error HOT 1
- Error when using with next.js HOT 1
- state not up to date HOT 3
- how to get the global state value outside of the component. HOT 1
- Setting up testing patterns for LSM (React Testing Lib + Jest) - LSM returns empty object in JSDOM HOT 1
- Access the CreateStore Outside a React Component HOT 1
- Dynamically set store name with data from backend HOT 1
- Changing schema of state - guidance on versioning/migrations?
- Type Error for actions without a payload.
- How to implement array of objects. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from little-state-machine.