Socket
Socket
Sign inDemoInstall

arrow-of-time

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arrow-of-time - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

common-b8ceae71e5cf456c4e00.js

27

index.js

@@ -601,2 +601,6 @@ module.exports =

eject: function eject() {
return snapshot;
},
getState: function getState() {

@@ -631,8 +635,21 @@ return snapshot.getState();

return function (snapshot) {
return _extends({}, store(subscribe(function (snapshot) {
return subscribers.forEach(function (f) {
return f(snapshot);
});
})(snapshot)), {
var plainStore = store(snapshot);
return _extends({}, plainStore, {
dispatch: function dispatch(x) {
plainStore.dispatch(x);
subscribers.forEach(function (callback) {
return callback(_extends({}, plainStore.eject(), plainStore));
});
},
update: function update(f) {
plainStore.update(f);
subscribers.forEach(function (callback) {
return callback(_extends({}, plainStore.eject(), plainStore));
});
},
subscribe: function subscribe(callback) {

@@ -639,0 +656,0 @@ subscribers.push(callback);

3

package.json
{
"name": "arrow-of-time",
"version": "0.1.2",
"version": "0.1.3",
"description": "Experiment with minimum possible composable implementation of a history (such as a Redux store, Act history, etc).",
"main": "index.js",
"scripts": {
"clean": "git clean -f && rm -rf demo && rm -rf store && rm -rf timeline && rm -rf snapshot",
"test": "npm run test:lint && npm run test:unit",

@@ -8,0 +9,0 @@ "build": "sagui build",

@@ -81,5 +81,5 @@ # Arrow of time

timeline.rewind()
timeline.rewind()
timeline.redo()
timelines.push(timelines[2].rewind())
timelines.push(timelines[3].rewind())
timelines.push(timelines[4].redo())
```

@@ -86,0 +86,0 @@

@@ -10,2 +10,4 @@ import _subscribable from './subscribable'

eject: () => snapshot,
getState: () => snapshot.getState(),

@@ -12,0 +14,0 @@

@@ -5,11 +5,24 @@ export default (subscribe) => (store) => {

return (snapshot) => {
const plainStore = store(snapshot)
return {
...store(
subscribe(
(snapshot) => subscribers.forEach((f) => f(snapshot))
)(
snapshot
)
),
...plainStore,
dispatch: (x) => {
plainStore.dispatch(x)
subscribers.forEach((callback) => callback({
...plainStore.eject(),
...plainStore
}))
},
update: (f) => {
plainStore.update(f)
subscribers.forEach((callback) => callback({
...plainStore.eject(),
...plainStore
}))
},
subscribe: (callback) => {

@@ -16,0 +29,0 @@ subscribers.push(callback)

@@ -75,2 +75,6 @@ module.exports =

eject: function eject() {
return snapshot;
},
getState: function getState() {

@@ -105,8 +109,21 @@ return snapshot.getState();

return function (snapshot) {
return _extends({}, store(subscribe(function (snapshot) {
return subscribers.forEach(function (f) {
return f(snapshot);
});
})(snapshot)), {
var plainStore = store(snapshot);
return _extends({}, plainStore, {
dispatch: function dispatch(x) {
plainStore.dispatch(x);
subscribers.forEach(function (callback) {
return callback(_extends({}, plainStore.eject(), plainStore));
});
},
update: function update(f) {
plainStore.update(f);
subscribers.forEach(function (callback) {
return callback(_extends({}, plainStore.eject(), plainStore));
});
},
subscribe: function subscribe(callback) {

@@ -113,0 +130,0 @@ subscribers.push(callback);

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc