choojs / choojs/nanocomponent

Document private vars

Open
#55 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
364
Forks
29
PR merge metrics
No merged PRs in 30d

Description

I don't know of a good way to protect private vars from being overwritten. I know @toddself accidentally ran into the situation where he overwrote a private var. Perhaps we could add a list of private vars not to overwrite.

```js
this._hasWindow = typeof window !== 'undefined'
this._id = null // represents the id of the root node
this._ncID = null // internal nanocomponent id
this._proxy = null
this._loaded = false // Used to debounce on-load when child-reordering
this._rootNodeName = null
this._name = name || 'nanocomponent'
this._arguments = []

this._handleLoad = this._handleLoad.bind(this)
this._handleUnload = this._handleUnload.bind(this)
```

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names no source file or test; start by locating the component initialization that assigns the listed private variables. Determine the intended behavior for preventing those variables from being overwritten, then document or test the agreed protection rules so accidental overwrites are covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.