Socket
Socket
Sign inDemoInstall

little-atom

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

little-atom - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

2

package.json
{
"name": "little-atom",
"version": "0.2.0",
"version": "0.2.1",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -19,21 +19,21 @@ # little-atom

const actions = {
increaseScore (atom, points) {
const { score } = atom.get()
atom.mutate({ score: score + points })
atom.checkCount()
increaseScore ({ get, mutate, actions }, points) {
const { score } = get()
mutate({ score: score + points })
actions.checkScore()
},
decreaseScore (atom, points) {
const { score } = atom.get()
atom.mutate({ score: score - points })
decreaseScore ({ get, mutate, actions }, points) {
const { score } = get()
mutate({ score: score - points })
},
checkScore (atom, payload) {
const { score } = atom.get()
checkScore ({ get, mutate, actions }, payload) {
const { score } = get()
if (score >= 1000) {
console.log('You win! ...something')
atom.restart()
actions.restart()
}
},
restart (atom, payload) {
restart ({ get, mutate, actions }, payload) {
console.log('Restarting')
atom.mutate(initialState)
mutate(initialState)
}

@@ -48,9 +48,9 @@ }

atom.increaseScore(500)
atom.actions.increaseScore(500)
// -> Your score is 500
atom.decreaseScore(100)
atom.actions.decreaseScore(100)
// -> Your score is 400
atom.increaseScore(600)
atom.actions.increaseScore(600)
// -> Your score is 1000

@@ -57,0 +57,0 @@ // -> You win! ...something

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