Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fitbit-views

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fitbit-views

Manage Views and navigation in Fitbit apps

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Fitbit Views

npm version CI Status

Build rich Fitbit apps with ease. This module will take care of:

  • Lazily loading your GUI files.
  • Provide basic navigation functions: next and back.

Add it to your project

npm install --save fitbit-views

Use it

In your project, you will have your views files like the following example:

  • resources/view-1.gui.
  • resources/view-2.gui.

Your view runtime code simlar to:

  • app/views/view-1.js.
  • app/views/view-2.js.

The main file for your app:

  • app/index.js.

So with that in mind...

Setup your views

index.js

import { setup, next } from 'fitbit-views';
import view1 from './views/view-1';
import view2 from './views/view-2';

setup({
	'view-1': view1,
	'view-2': view2,
});
next('view-1');

Bring your view to life

view-1.js

import document from 'document';
import { next } from 'fitbit-views';

export default () => {
	document.getElementById('some-text').text = 'Hi there :)';
	document.getElementById('my-button').onactivate = () => next('view-2');
};

You get the idea!

What's in the box

  • setup: initialize your views.
  • next: navigate forwards. You can also pass a parameter.
  • back: navigate backwards. You can also pass a parameter.

Your view functions will be called with the passed parameter (if any). Bear in mind that your view may be using extra resources that must be disposed before navigating to another view. In that case, just return a callback at the end of your view function, and it will be called right before navigating.

You can also take a look at the API in the code. There you'll find also how to create fully dynamic views, including the GUI content. This enable developers to create and pack full views (both UI and functionality).

Keywords

FAQs

Package last updated on 21 Mar 2020

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

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