gitwtfhub

wtf is blaze-local-state?

yyx990803/blaze-local-state — explained in plain English

Analysis updated 2026-07-17 · repo last pushed 2015-03-25

6JavaScriptAudience · developerComplexity · 2/5DormantSetup · easy

TL;DR

A package that gives Blaze templates their own local state, so each template instance can track values like counters without sharing a global session.

Mindmap

mindmap
  root((repo))
    What it does
      Per-instance state
      Replaces global Session
      Auto re-render
    Tech stack
      JavaScript
      Blaze
      Meteor
    Use cases
      Track form validation
      Track active carousel slide
      Track dropdown open state
    Audience
      Blaze developers
      Meteor developers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Track per-instance state like form validation errors without polluting the global Session.

REASON 2

Manage which carousel slide or dropdown is active independently across multiple template copies.

REASON 3

Reduce boilerplate helpers and event handlers for simple template-local state.

What's in the stack?

JavaScriptBlazeMeteor

How it stacks up

yyx990803/blaze-local-statearthurmoorgan/driftatom/etch-list-view
Stars666
LanguageJavaScriptJavaScriptJavaScript
Last pushed2015-03-252020-04-28
MaintenanceDormantDormant
Setup difficultyeasymoderatemoderate
Complexity2/52/52/5
Audiencedevelopergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 5min

Only works within Blaze templates, not modern frameworks like Vue or React.

No license information was found in the explanation.

Wtf does this do

This package solves a common problem in Blaze templates (a templating system for building web interfaces) where developers need to keep track of changing data that's specific to one template instance. Normally, developers use a global "Session" to store values like counters or form inputs. The problem is that this global storage gets messy: if you have the same template used twice on a page, both instances share the same counter, making it hard to keep them independent. You also have to write a lot of boilerplate code to set up helpers and manage state changes. This package cuts through that by letting you define local state that belongs to a single template instance, similar to how component state works in modern frameworks. Here's how it works in practice: instead of manually creating helpers and event handlers that read from and write to a global Session, you tell your template "here's the initial state I want" (like { counter: 0 }), and the package automatically makes it available. Within your template's event handlers, you can then call simple methods like template.get('counter') and template.set('counter', newValue) to read and update that state. When the state changes, the template re-renders automatically to show the new value. This would be useful for any Blaze developer building interactive templates, think of a form where you're tracking validation errors, a carousel tracking which slide is active, or a dropdown tracking whether it's open or closed. Instead of polluting your global Session namespace or repeating the same boilerplate, you keep the state local and tidy. The tradeoff is that this only works within Blaze, if you're using a modern framework like Vue or React, you'd have similar state management features built in. But for Blaze projects, it's a practical way to write less code and avoid common bugs from shared global state.

Yoink these prompts

Prompt 1
Show me how to use blaze-local-state to track a counter that's independent per template instance.
Prompt 2
Explain how this differs from using Meteor's global Session for template state.
Prompt 3
Help me refactor an existing Blaze template's Session-based state to use this package instead.

Frequently asked questions

wtf is blaze-local-state?

A package that gives Blaze templates their own local state, so each template instance can track values like counters without sharing a global session.

What language is blaze-local-state written in?

Mainly JavaScript. The stack also includes JavaScript, Blaze, Meteor.

Is blaze-local-state actively maintained?

Dormant — no commits in 2+ years (last push 2015-03-25).

What license does blaze-local-state use?

No license information was found in the explanation.

How hard is blaze-local-state to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is blaze-local-state for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.