Skip to content

Commit

Permalink
Rename atomicTransactions util to just atomic
Browse files Browse the repository at this point in the history
  • Loading branch information
goatslacker committed Apr 25, 2015
1 parent 838d8cb commit ff6c285
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/utils/atomicTransactions.js → src/utils/atomic.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function makeAtomicObject(alt, StoreModel) {
return StoreModel
}

export default function atomicTransactions(alt) {
export default function atomic(alt) {
var finalStore = makeFinalStore(alt)

finalStore.listen(() => alt.takeSnapshot())
Expand Down
7 changes: 4 additions & 3 deletions test/atomic-transactions-test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { assert } from 'chai'
import Alt from '../dist/alt-with-runtime'
import atomicTransactions from '../utils/atomicTransactions'
import atomic from '../utils/atomic'

const alt = new Alt()

const atom = atomicTransactions(alt)
const atom = atomic(alt)

const actions = alt.generateActions('fire')

Expand Down Expand Up @@ -40,6 +40,7 @@ const store2 = alt.createStore(atom({
}
}))

@atomic(alt)
class Store3 {
constructor() {
this.bindListeners({ fire: actions.fire })
Expand All @@ -51,7 +52,7 @@ class Store3 {
}
}

const store3 = alt.createStore(atom(Store3), 'Store3')
const store3 = alt.createStore(Store3, 'Store3')

class Store4 {
constructor() {
Expand Down

0 comments on commit ff6c285

Please sign in to comment.