Leverege Platform

Leverege Platform

  • Overview
  • JSDocs
  • REST API
  • Help

›UI

Platform Overview

  • Overview
  • Architecture
  • Core Concepts

Guides

  • Platform Setup
  • Building a Project
  • API UI

Services

  • API Server
  • Message Processor
  • Transponder
  • Reason
  • Scheduler
  • Messenger
  • Emailer
  • Rest Server
  • DB Curator

API

  • API
  • Interface
  • Project
  • System
  • Device
  • Blueprint
  • Collection
  • Child
  • History
  • Scenario
  • Script
  • Template
  • Timer
  • User
  • Users

Server Libraries

  • Log
  • Messages
  • Message Queue
  • Cache
  • Lock
  • Limit
  • Cluster Manager
  • Error
  • Exit

Utilities

  • Promise
  • Data Store
  • Factory
  • Path
  • Reasoner
  • Object Util
  • Array Util
  • String Util
  • Base62 Util
  • Value Cache
  • Validator
  • Lol

UI

  • API Redux
  • UI Builder
  • UI Elements
  • UI Redux
  • UI Mapbox Elements
  • UI Active Theme
  • UI Color Elements
  • UI Linear View Elements

UI Redux

UI-redux contains some commonly used front end functionality and integrates it with redux to make it easily used across and app.

Installation

npm install @leverege/ui-redux --save

Reducer Setup

When creating the reducers, include the InterfaceReducer

import { combineReducers } from 'redux' 
import { SelectReducer, UIReducer } from 'ui-redux'
...

const reducers = combineReducers( {
  ...
  select : Select,
  ui : UI
} )

export default reducers

Actions and Access

select

select is a reducer responsible for maintaining arrays (groups) of items that have been selected.

import { select } from '@leverege/ui-redux'

dispatch( select.add( UUID, myGroup ) )

the methods on select are

  1. add( ids, group ) - adds ids to the specified group
  2. set( ids, group ) - changes the group to be the ids provided
  3. remove( ids, group ) - removes the ids from the group
  4. toggle( ids, group ) - if in group, removes id, if not in group adds id; for each id
  5. clear( group ) - resets the group to no selection
  6. clearAll() - resets all groups to no selection
  7. isSelected( groupData, id ) - checks if an item is in a group
  8. count( groupData ) - count of the number of items in a group
  9. isEmpty( groupData ) - checks if group is empty

UI

UI is a simple reducer that maintains keys.

import { UI } from '@leverege/ui-redux'

dispatch( UI.set( myKey, myValue ) )

the UI methods are

  1. set( key, value ) - sets the value of the key
  2. multiSet( keyValue ) - object that has all of its keys and values set
← UI ElementsUI Mapbox Elements →
  • Installation
  • Reducer Setup
  • Actions and Access
    • select
    • UI
Leverege Platform
Docs
Overview
Connect
FacebookLinkedInTwitter
Facebook Open Source