Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

redux-effects-geolocation

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redux-effects-geolocation

redux-effects middleware for Geolocation API

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
2
Created
Source

redux-effects-geolocation

redux-effects middleware for Geolocation API.

Installation

npm install --save redux-effects-geolocation

Usage

Installing the middleware

import { createStore, applyMiddleware } from 'redux';
import geoMiddleware from 'redux-effects-geolocation';
import rootReducer from './reducers';

const store = createStore(
  rootReducer,
  applyMiddleware(
    geoMiddleware()
  )
);

Using Actions:

getting current position:

import { getPosition } from 'redux-effects-geolocation';

const propmise = store.dispatch(getPosition());

getting current position with options:

import { getPosition } from 'redux-effects-geolocation';

const propmise = store.dispatch(getPosition({ enableHighAccuracy: true }));

Note: If Geolocation API is not available, the Promise is always rejected.

API

Action Creators

getPosition([options])

Arguments
  • options (Object): See MDN for more info.
Returns
  • (Object): An action object.

Keywords

actions

FAQs

Package last updated on 26 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts