diff --git a/actions.js b/actions.js index 35e1037..6d6e2db 100644 --- a/actions.js +++ b/actions.js @@ -1 +1,2 @@ -export { ACTION_SET_POSITION, ACTION_SET_ERROR } from './actions/index'; +export { REDUX_SAGA_LOCATION_ACTION_SET_POSITION + , REDUX_SAGA_LOCATION_ACTION_SET_ERROR } from './actions/index'; diff --git a/package.json b/package.json index 8aac5e1..d4641ce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "redux-saga-location", - "version": "1.0.3", + "version": "1.0.4", "description": "Location-support for reduy-saga", "main": "index.js", "scripts": { diff --git a/reducer/location.js b/reducer/location.js index e6cd288..a8b7103 100644 --- a/reducer/location.js +++ b/reducer/location.js @@ -1,4 +1,5 @@ -import {ACTION_SET_POSITION, ACTION_SET_ERROR} from '../actions'; +import {REDUX_SAGA_LOCATION_ACTION_SET_POSITION + , REDUX_SAGA_LOCATION_ACTION_SET_ERROR} from '../actions'; export default function locationReducer(state = { position: null, @@ -6,7 +7,7 @@ export default function locationReducer(state = { }, action) { switch(action.type) { - case ACTION_SET_POSITION: { + case REDUX_SAGA_LOCATION_ACTION_SET_POSITION: { const {position} = action; return { @@ -16,7 +17,7 @@ export default function locationReducer(state = { } } - case ACTION_SET_ERROR : { + case REDUX_SAGA_LOCATION_ACTION_SET_ERROR : { const {error} = action; return { diff --git a/saga/location.js b/saga/location.js index e6c3c36..b086c3a 100644 --- a/saga/location.js +++ b/saga/location.js @@ -4,7 +4,8 @@ import { take, put, call } from 'redux-saga/effects'; export const locationChannel = channel() -import {ACTION_SET_POSITION, ACTION_SET_ERROR} from '../actions'; +import {REDUX_SAGA_LOCATION_ACTION_SET_POSITION + , REDUX_SAGA_LOCATION_ACTION_SET_ERROR} from '../actions'; export function * watchLocationChannel() { while (true) { @@ -16,9 +17,9 @@ export function * watchLocationChannel() { export function * getCurrentPosition(options) { navigator.geolocation.getCurrentPosition( position => { - locationChannel.put({type: ACTION_SET_POSITION, position}) + locationChannel.put({type: REDUX_SAGA_LOCATION_ACTION_SET_POSITION, position}) }, - (error) => locationChannel.put({type: ACTION_SET_ERROR, error}), + (error) => locationChannel.put({type: REDUX_SAGA_LOCATION_ACTION_SET_ERROR, error}), options );