Skip to content

Commit

Permalink
🎨 use mobx-state-tree getPath helper (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabienjuif authored Oct 25, 2017
1 parent d5826e6 commit dc10376
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "trampss-mst-onaction",
"version": "0.8.0",
"version": "0.8.1",
"main": "index.js",
"repository": "[email protected]:Trampss/trampss-mst-onaction.git",
"author": "Fabien JUIF <[email protected]>",
Expand All @@ -25,12 +25,16 @@
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-react": "^7.4.0",
"mobx-state-tree": "^1.0.1",
"npm-run-all": "^4.1.1",
"rollup": "^0.50.0",
"rollup-plugin-babel": "^3.0.2",
"rollup-plugin-commonjs": "^8.2.4",
"rollup-plugin-uglify": "^2.0.1"
},
"peerDependencies": {
"mobx-state-tree": "^1.0.1"
},
"babel": {
"presets": [
[
Expand Down Expand Up @@ -79,6 +83,7 @@
"browser": true
},
"rules": {
"import/no-extraneous-dependencies": "off",
"semi": [
2,
"never"
Expand Down
7 changes: 3 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { getPath } from 'mobx-state-tree'

const getAction = (call) => {
const {
name,
Expand All @@ -6,10 +8,7 @@ const getAction = (call) => {
args,
} = call

const {
path,
} = context.$treenode

const path = getPath(context)
const fullpath = `${path}/${name}`

const action = {
Expand Down
4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1906,6 +1906,10 @@ minimist@^1.2.0:
dependencies:
minimist "0.0.8"

mobx-state-tree@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/mobx-state-tree/-/mobx-state-tree-1.0.1.tgz#7b42616e5947e36d4c3413b404c2800b79c4305b"

[email protected]:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
Expand Down

0 comments on commit dc10376

Please sign in to comment.