Skip to content

Commit

Permalink
feat: rename activate to immediate
Browse files Browse the repository at this point in the history
  • Loading branch information
yyxi committed Nov 25, 2024
1 parent d07e736 commit cf657cd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export class Snaproll {
this.store = createStore(options)
}

private idle() {
public idle() {
const store = this.store

if (store.state !== TypeState.Active || subscriptionActive(store.subscriptions)) {
Expand Down Expand Up @@ -329,15 +329,15 @@ export class Snaproll {

public subscribe(
value: SnaprollSubscription,
options?: { activate?: boolean },
options?: { immediate?: boolean },
): SnaprollSubscriptionControls {
// eslint-disable-next-line typescript/no-this-alias
const self = this
const state = self.store

if (subscriptionFind(value, state.subscriptions) === undefined) {
const reference = state.subscriptions
const active = options?.activate !== false
const active = options?.immediate !== false
state.subscriptions = [...reference, { active, value }]

if (state.state === TypeState.Idle) {
Expand Down

0 comments on commit cf657cd

Please sign in to comment.