developit / developit/stockroom
Differences in the inline and the normal way
- Dominant language
- JavaScript
- Stars
- 1.7k
- Forks
- 44
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I expect a lot of bug with stockroom (or maybe I using it wrong ?)
I extract a little part of my webapp to inspect it, but I encounter an (other) probleme.
To reproduce the bugs : https://github.com/Buom01/stockroom-bug-demo (created with preact-cli)
## the `subscribe` method
In this case, the "normal" usage, the store have not got the `subscribe` method defined:
```javascript
import createStore from 'stockroom/inline'
import StoreWorker from 'workerize-loader!./worker.store'
let store = createStore(new StoreWorker())
console.log(store.subscribe) // undefined, WHY ?
```
While in the "inline" usage, the method `subscribe` is defined normally:
```javascript
import createStore from 'stockroom/inline'
let store = createStore(require('./worker.store').default)
console.log(store.subscribe) // defined as a function
````
## A probleme of shared store in the "inline" mod
Sorry because I can not totally reproduce the bug that I want to resolve due to the probleme with the `subscribe` method.
The probleme can be showed partially in the demo provided: I add only one document to each store, but in the inline mod, the store are mixed and finally they share their data. Then, they have both the same data while they should be isolated like in the worker mod. (Confirmed in my local project)
Tested in both Chromium(Version 67.0.3396.79 (Build de développement) Fedora Project (64 bits)) and Firefox(61.0) (latest)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.